@oj-module/cli 0.2.53 → 0.2.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/devkit/SKILL.md +4 -4
- package/devkit/manual.md +79 -65
- package/package.json +2 -2
- package/shell-dist/assets/{index-e_Mp2mb5.js → index-CImwskAz.js} +24 -11
- package/shell-dist/assets/runtime.js +7 -4
- package/shell-dist/index.html +3 -3
- package/shell-dist/versions.json +3 -3
- package/src/__tests__/layout.test.ts +30 -1
- package/src/__tests__/templates-schema-columns.test.ts +99 -0
- package/src/__tests__/templates-tenant-scope.test.ts +3 -2
- package/src/alias-paths.ts +11 -12
- package/src/builtin.ts +10 -3
- package/src/config.ts +9 -0
- package/src/contract/__tests__/client-path.test.ts +30 -0
- package/src/contract/__tests__/emit-client.test.ts +20 -2
- package/src/contract/__tests__/handler-scan.test.ts +23 -0
- package/src/contract/__tests__/market-client.integration.test.ts +2 -2
- package/src/contract/__tests__/run-api.test.ts +2 -2
- package/src/contract/check.ts +11 -7
- package/src/contract/client-path.ts +30 -0
- package/src/contract/emit-client.ts +27 -6
- package/src/contract/handler-scan.ts +40 -3
- package/src/contract/run.ts +15 -5
- package/src/init.ts +29 -3
- package/src/layout.ts +72 -16
- package/src/lifecycle/__tests__/manifest-contract.test.ts +2 -2
- package/src/market/__tests__/bootstrap.test.ts +1 -1
- package/src/site.ts +1 -1
- package/templates/README.md +49 -43
- package/templates/init.include.yaml +31 -19
- package/templates/openapi.json +1488 -120
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/domain/users.ts +27 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/infra/oplog.ts +4 -2
- package/templates/src/{_platform/api → app/api/_platform}/contacts/api.ts +29 -1
- package/templates/src/{_platform/api → app/api/_platform}/contacts/detail/api.ts +25 -1
- package/templates/src/app/api/_platform/migrations/0017__users_employee_no.mysql.sql +7 -0
- package/templates/src/app/api/_platform/migrations/0017__users_employee_no.pg.sql +4 -0
- package/templates/src/app/api/_platform/migrations/0017__users_employee_no.sql +8 -0
- package/templates/src/{_platform/api → app/api/_platform}/schema.yaml +5 -0
- package/templates/src/{_platform/api → app/api/_platform}/solutions/api.ts +60 -1
- package/templates/src/{auth/api → app/api/auth}/_shared/wecom/replay.ts +9 -3
- package/templates/src/{auth/api → app/api/auth}/_shared/wecom/tenant-admin.ts +18 -27
- package/templates/src/{auth/api → app/api/auth}/api.ts +59 -0
- package/templates/src/{auth/api → app/api/auth}/ldap-login/api.ts +37 -1
- package/templates/src/{auth/api → app/api/auth}/wecom/api.ts +23 -0
- package/templates/src/{notification/api → app/api/notification}/api.ts +17 -0
- package/templates/src/{notification/api → app/api/notification}/del/api.ts +2 -0
- package/templates/src/{system/api → app/api/system}/oplog/api.ts +5 -3
- package/templates/src/{system/api → app/api/system}/roles/api.ts +3 -0
- package/templates/src/{system/api → app/api/system}/roles/bindings/api.ts +3 -0
- package/templates/src/{system/api → app/api/system}/settings/api.ts +3 -0
- package/templates/src/{system/api → app/api/system}/users/forbidden/api.ts +3 -0
- package/templates/src/{system/api → app/api/system}/users/password/api.ts +3 -0
- package/templates/src/{system/api → app/api/system}/users/roles/api.ts +3 -0
- package/templates/src/app/api/web/get-async-routes/api.ts +23 -0
- package/templates/src/app/api/web/hello/api.ts +22 -0
- package/templates/src/{web/api → app/api/web}/user-info/api.ts +21 -1
- package/templates/src/{_platform/web → app/web/_platform}/__client/api.schemas.ts +99 -35
- package/templates/src/{_platform/web/__client/api.ts → app/web/_platform/__client/index.ts} +108 -61
- package/templates/src/{auth/web → app/web/auth}/__client/api.schemas.ts +133 -13
- package/templates/src/{auth/web/__client/api.ts → app/web/auth/__client/index.ts} +134 -33
- package/templates/src/app/web/entry.ts +77 -0
- package/templates/src/{home/web/__client/api.ts → app/web/home/__client/index.ts} +5 -2
- package/templates/src/app/web/home/routes.ts +41 -0
- package/templates/src/app/web/login/routes.ts +71 -0
- package/templates/src/{notification/web → app/web/notification}/__client/api.schemas.ts +14 -0
- package/templates/src/{notification/web/__client/api.ts → app/web/notification/__client/index.ts} +67 -20
- package/templates/src/{notification/web → app/web/notification}/pages/center/index.tsx +1 -1
- package/templates/src/app/web/notification/routes.ts +70 -0
- package/templates/src/{personal-center/web/__client/api.ts → app/web/personal-center/__client/index.ts} +5 -2
- package/templates/src/{personal-center/web → app/web/personal-center}/pages/my-profile/index.tsx +1 -1
- package/templates/src/app/web/personal-center/routes.ts +49 -0
- package/templates/src/{system/web → app/web/system}/__client/api.schemas.ts +29 -22
- package/templates/src/{system/web/__client/api.ts → app/web/system/__client/index.ts} +103 -58
- package/templates/src/{system/web → app/web/system}/locales/en-US.json +2 -3
- package/templates/src/{system/web → app/web/system}/locales/zh-CN.json +2 -3
- package/templates/src/{system/web → app/web/system}/pages/departments/index.tsx +2 -2
- package/templates/src/{system/web → app/web/system}/pages/login-methods/index.tsx +1 -1
- package/templates/src/{system/web → app/web/system}/pages/oplog/index.tsx +44 -19
- package/templates/src/{system/web → app/web/system}/pages/roles/index.tsx +5 -3
- package/templates/src/app/web/system/pages/roles/visible-roles.ts +14 -0
- package/templates/src/{system/web → app/web/system}/pages/settings/index.tsx +2 -2
- package/templates/src/app/web/system/pages/users/can-manage.ts +21 -0
- package/templates/src/{system/web → app/web/system}/pages/users/index.tsx +23 -15
- package/templates/src/{system/web → app/web/system}/pages/users/roles.tsx +1 -1
- package/templates/src/{system/web → app/web/system}/pages/wecom/index.tsx +12 -3
- package/templates/src/{system/web/entry.ts → app/web/system/routes.ts} +25 -36
- package/templates/src/app/web/web/__client/api.schemas.ts +36 -0
- package/templates/src/{web/web/__client/api.ts → app/web/web/__client/index.ts} +38 -11
- package/templates/src/oj-market/web/api/defaultClient.ts +1 -1
- package/templates/tests/auth-ldap.spec.ts +2 -2
- package/templates/tests/auth-session.spec.ts +3 -3
- package/templates/tests/auth-throttle.spec.ts +1 -1
- package/templates/tests/fixture.ts +6 -4
- package/templates/tests/guard.spec.ts +1 -1
- package/templates/tests/lifecycle/atomic-state.spec.ts +3 -3
- package/templates/tests/lifecycle/bootstrap.spec.ts +3 -3
- package/templates/tests/lifecycle/deploy-smoke.spec.ts +8 -8
- package/templates/tests/lifecycle/installer.spec.ts +10 -10
- package/templates/tests/lifecycle/market-api.spec.ts +14 -14
- package/templates/tests/lifecycle/migrate.spec.ts +6 -6
- package/templates/tests/lifecycle/preflight.spec.ts +3 -3
- package/templates/tests/lifecycle/register.spec.ts +1 -1
- package/templates/tests/lifecycle/semver.spec.ts +1 -1
- package/templates/tests/lifecycle/sha384.spec.ts +1 -1
- package/templates/tests/lifecycle/solutions-api.spec.ts +1 -1
- package/templates/tests/lifecycle/source-seq.spec.ts +1 -1
- package/templates/tests/lifecycle/steps-fs.spec.ts +9 -9
- package/templates/tests/lifecycle/text-edit.spec.ts +1 -1
- package/templates/tests/lifecycle/tgz-guard.spec.ts +2 -2
- package/templates/tests/lifecycle/trust.spec.ts +5 -5
- package/templates/tests/lifecycle/uninstall.spec.ts +7 -7
- package/templates/tests/lifecycle/verify-checks.spec.ts +5 -5
- package/templates/tests/lifecycle/verify-report.spec.ts +4 -4
- package/templates/tests/org-departments.spec.ts +10 -6
- package/templates/tests/org-read.spec.ts +7 -7
- package/templates/tests/query-utils.spec.ts +1 -1
- package/templates/tests/rbac-audit.spec.ts +1 -1
- package/templates/tests/rbac-contacts.spec.ts +2 -2
- package/templates/tests/rbac-guard.spec.ts +1 -1
- package/templates/tests/rbac-roles.spec.ts +10 -2
- package/templates/tests/rbac-seed.spec.ts +1 -1
- package/templates/tests/rbac-settings.spec.ts +77 -7
- package/templates/tests/rbac-solution-perms.spec.ts +1 -1
- package/templates/tests/rbac-tables.spec.ts +29 -0
- package/templates/tests/rbac-users.spec.ts +55 -3
- package/templates/tests/roles-page.spec.ts +40 -0
- package/templates/tests/seed-role-accounts.spec.ts +1 -1
- package/templates/tests/tenant-access-cache.spec.ts +1 -1
- package/templates/tests/tenant-forgery.spec.ts +5 -5
- package/templates/tests/tenant-isolation.spec.ts +5 -4
- package/templates/tests/username-namespace.spec.ts +3 -3
- package/templates/tests/users-page.spec.ts +39 -0
- package/templates/tests/wecom-admin.spec.ts +6 -6
- package/templates/tests/wecom-client-timeout.spec.ts +1 -1
- package/templates/tests/wecom-connector.spec.ts +9 -9
- package/templates/tests/wecom-corp.spec.ts +9 -9
- package/templates/tests/wecom-crypt.spec.ts +1 -1
- package/templates/tests/wecom-endpoints.spec.ts +2 -2
- package/templates/tests/wecom-landing.spec.ts +1 -1
- package/templates/tests/wecom-org-sync.spec.ts +7 -7
- package/templates/tests/wecom-sync.spec.ts +3 -3
- package/templates/tsconfig.paths.json +11 -11
- package/templates/vitest.config.ts +2 -2
- package/templates/web.config.ts +24 -15
- package/vendor/host-versions.json +3 -3
- package/templates/src/home/web/entry.ts +0 -49
- package/templates/src/login/web/entry.ts +0 -79
- package/templates/src/notification/web/entry.ts +0 -84
- package/templates/src/personal-center/web/entry.ts +0 -60
- package/templates/src/web/api/get-async-routes/api.ts +0 -8
- package/templates/src/web/api/hello/api.ts +0 -10
- package/templates/src/web/web/__client/api.schemas.ts +0 -8
- package/templates/src/{_platform/api → app/api/_platform}/README.md +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/atomic.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/history.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/installer.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/limits.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/lock.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/semver.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/sha384.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/source-seq.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/state.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/steps/deploy-web.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/steps/download.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/steps/extract.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/steps/migrate.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/steps/preflight.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/steps/register.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/steps/reload.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/steps/smoke.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/steps/verify.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/tasks.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/text-edit.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/tgz-guard.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/trust.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/types.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/uninstall.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/verify-checks.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_lifecycle/verify-report.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/respond.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/domain/contacts.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/domain/org-read.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/domain/org.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/domain/roles.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/domain/settings.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/domain/solution-perms.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/infra/access.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/infra/audit.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/infra/guard.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/infra/query.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/service/infra/rate.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/_shared/site-facade.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/fixtures/l1-test-user.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/manifest.yaml +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/market/api.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/market/bootstrap.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/market/index-source.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0001__create_users.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0001__create_users.pg.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0001__create_users.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0002__add_users_avatar_base64.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0002__add_users_avatar_base64.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0003__users_source_display_name.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0003__users_source_display_name.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0004__sys_rbac.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0004__sys_rbac.pg.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0004__sys_rbac.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0005__users_must_change.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0005__users_must_change.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0006__users_is_forbidden.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0006__users_is_forbidden.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0007__users_email.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0008__sys_refresh_token.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0008__sys_refresh_token.pg.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0008__sys_refresh_token.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0009__sys_throttle.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0009__sys_throttle.pg.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0009__sys_throttle.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0010__sys_solution_route.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0010__sys_solution_route.pg.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0010__sys_solution_route.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0011__sys_setting_group_label.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0011__sys_setting_group_label.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0012__market_history.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0012__market_history.pg.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0012__market_history.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0013__users_profile.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0014__reg_source_seq.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0014__reg_source_seq.pg.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0014__reg_source_seq.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0015__tenant.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0015__tenant.pg.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0015__tenant.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0016__org.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0016__org.pg.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/migrations/0016__org.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/org/departments/api.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/org/is-member/api.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/org/members/api.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/org/picker/api.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/org/resolve/api.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/org/tree/api.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/org/user/api.ts +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/seed.mysql.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/seed.pg.sql +0 -0
- package/templates/src/{_platform/api → app/api/_platform}/seed.sql +0 -0
- package/templates/src/{auth/api → app/api/auth}/_shared/ldap-login.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/_shared/ldap.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/_shared/login-throttle.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/_shared/session.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/_shared/wecom/admin.ts +1 -1
- package/templates/src/{auth/api → app/api/auth}/_shared/wecom/client.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/_shared/wecom/config.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/_shared/wecom/contacts.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/_shared/wecom/crypt.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/_shared/wecom/events.ts +1 -1
- package/templates/src/{auth/api → app/api/auth}/_shared/wecom/login.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/_shared/wecom/payload.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/_shared/wecom/store.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/_shared/wecom/sync.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/manifest.yaml +0 -0
- package/templates/src/{auth/api → app/api/auth}/migrations/0001__wecom.mysql.sql +0 -0
- package/templates/src/{auth/api → app/api/auth}/migrations/0001__wecom.pg.sql +0 -0
- package/templates/src/{auth/api → app/api/auth}/migrations/0001__wecom.sql +0 -0
- package/templates/src/{auth/api → app/api/auth}/migrations/0002__org_sync.mysql.sql +0 -0
- package/templates/src/{auth/api → app/api/auth}/migrations/0002__org_sync.pg.sql +0 -0
- package/templates/src/{auth/api → app/api/auth}/migrations/0002__org_sync.sql +0 -0
- package/templates/src/{auth/api → app/api/auth}/migrations/0003__credential_kind.mysql.sql +0 -0
- package/templates/src/{auth/api → app/api/auth}/migrations/0003__credential_kind.pg.sql +0 -0
- package/templates/src/{auth/api → app/api/auth}/migrations/0003__credential_kind.sql +0 -0
- package/templates/src/{auth/api → app/api/auth}/schema.yaml +0 -0
- package/templates/src/{auth/api → app/api/auth}/wecom/admin/api.ts +0 -0
- package/templates/src/{auth/api → app/api/auth}/wecom/admin/tenant-admin/api.ts +1 -1
- package/templates/src/{auth/api → app/api/auth}/wecom/admin/tenant-admin/password/api.ts +1 -1
- /package/templates/src/{auth/api → app/api/auth}/wecom/sync/api.ts +0 -0
- /package/templates/src/{home/api → app/api/home}/line/api.ts +0 -0
- /package/templates/src/{home/api → app/api/home}/manifest.yaml +0 -0
- /package/templates/src/{home/api → app/api/home}/migrations/0001__create_home_tables.sql +0 -0
- /package/templates/src/{home/api → app/api/home}/migrations/0002__tenant.mysql.sql +0 -0
- /package/templates/src/{home/api → app/api/home}/migrations/0002__tenant.sql +0 -0
- /package/templates/src/{home/api → app/api/home}/pie/api.ts +0 -0
- /package/templates/src/{home/api → app/api/home}/schema.yaml +0 -0
- /package/templates/src/{home/api → app/api/home}/seed.sql +0 -0
- /package/templates/src/{notification/api → app/api/notification}/_shared/notify.ts +0 -0
- /package/templates/src/{notification/api → app/api/notification}/manifest.yaml +0 -0
- /package/templates/src/{notification/api → app/api/notification}/migrations/0001__create_notifications.sql +0 -0
- /package/templates/src/{notification/api → app/api/notification}/migrations/0002__notifications_user.sql +0 -0
- /package/templates/src/{notification/api → app/api/notification}/migrations/0003__notifications_broadcast.sql +0 -0
- /package/templates/src/{notification/api → app/api/notification}/migrations/0004__notifications_broadcast_hidden.sql +0 -0
- /package/templates/src/{notification/api → app/api/notification}/migrations/0005__tenant.mysql.sql +0 -0
- /package/templates/src/{notification/api → app/api/notification}/migrations/0005__tenant.sql +0 -0
- /package/templates/src/{notification/api → app/api/notification}/schema.yaml +0 -0
- /package/templates/src/{notification/api → app/api/notification}/seed.sql +0 -0
- /package/templates/src/{personal-center/api → app/api/personal-center}/manifest.yaml +0 -0
- /package/templates/src/{personal-center/api → app/api/personal-center}/profile/api.ts +0 -0
- /package/templates/src/{personal-center/api → app/api/personal-center}/upload/api.ts +0 -0
- /package/templates/src/{system/api → app/api/system}/departments/api.ts +0 -0
- /package/templates/src/{system/api → app/api/system}/departments/detach/api.ts +0 -0
- /package/templates/src/{system/api → app/api/system}/departments/members/api.ts +0 -0
- /package/templates/src/{system/api → app/api/system}/departments/move/api.ts +0 -0
- /package/templates/src/{system/api → app/api/system}/login-methods/api.ts +0 -0
- /package/templates/src/{system/api → app/api/system}/manifest.yaml +0 -0
- /package/templates/src/{system/api → app/api/system}/permissions/api.ts +0 -0
- /package/templates/src/{system/api → app/api/system}/users/api.ts +0 -0
- /package/templates/src/{system/api → app/api/system}/users/profile/api.ts +0 -0
- /package/templates/src/{web/api → app/api/web}/manifest.yaml +0 -0
- /package/templates/src/{home/web → app/web/home}/__client/api.schemas.ts +0 -0
- /package/templates/src/{home/web → app/web/home}/locales/en-US.json +0 -0
- /package/templates/src/{home/web → app/web/home}/locales/zh-CN.json +0 -0
- /package/templates/src/{home/web → app/web/home}/pages/components/bar-chart.tsx +0 -0
- /package/templates/src/{home/web → app/web/home}/pages/components/card-list.tsx +0 -0
- /package/templates/src/{home/web → app/web/home}/pages/components/line-chart.tsx +0 -0
- /package/templates/src/{home/web → app/web/home}/pages/components/pie-chart.tsx +0 -0
- /package/templates/src/{home/web → app/web/home}/pages/index.tsx +0 -0
- /package/templates/src/{login/web → app/web/login}/auth-provider.ts +0 -0
- /package/templates/src/{login/web → app/web/login}/locales/en-US.json +0 -0
- /package/templates/src/{login/web → app/web/login}/locales/zh-CN.json +0 -0
- /package/templates/src/{login/web → app/web/login}/pages/change-password.tsx +0 -0
- /package/templates/src/{login/web → app/web/login}/pages/login.tsx +0 -0
- /package/templates/src/{login/web → app/web/login}/wecom.ts +0 -0
- /package/templates/src/{notification/web → app/web/notification}/locales/en-US.json +0 -0
- /package/templates/src/{notification/web → app/web/notification}/locales/zh-CN.json +0 -0
- /package/templates/src/{personal-center/web → app/web/personal-center}/__client/api.schemas.ts +0 -0
- /package/templates/src/{personal-center/web → app/web/personal-center}/locales/en-US.json +0 -0
- /package/templates/src/{personal-center/web → app/web/personal-center}/locales/zh-CN.json +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/departments/sync-bar.tsx +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/departments/tree.ts +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/errors.ts +0 -0
- /package/templates/src/{system/web → app/web/system}/pages/forbidden.tsx +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// GET /api/web/get-async-routes —— 后端动态路由(Bearer 守卫保护)。
|
|
2
|
+
// demo 返回空数组:模块路由由 web/src 静态注入;需要后端路由时按
|
|
3
|
+
// 宿主 RouteObject 形状返回。
|
|
4
|
+
const handler = {
|
|
5
|
+
get() {
|
|
6
|
+
json.ok([]);
|
|
7
|
+
},
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// 出参:宿主 RouteObject 形状的数组(demo 恒空数组;页面路由由前端静态注入)
|
|
11
|
+
handler.get.response = {
|
|
12
|
+
type: "array",
|
|
13
|
+
items: {
|
|
14
|
+
type: "object",
|
|
15
|
+
properties: {
|
|
16
|
+
path: { type: "string" },
|
|
17
|
+
component: { type: "string" },
|
|
18
|
+
children: { type: "array", items: { type: "object" } },
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default handler;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// GET /api/web/hello —— 演示业务端点(Bearer 守卫保护)。
|
|
2
|
+
// 改完保存即生效(oj dev/ts 热更);新增/删除模块目录需重启 ojm dev。
|
|
3
|
+
const handler = {
|
|
4
|
+
get() {
|
|
5
|
+
json.ok({
|
|
6
|
+
message: "hello from oj",
|
|
7
|
+
user: http.user?.id ?? null,
|
|
8
|
+
});
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// 出参:演示端点(hello 文案 + 当前用户 id)
|
|
13
|
+
handler.get.response = {
|
|
14
|
+
type: "object",
|
|
15
|
+
required: ["message", "user"],
|
|
16
|
+
properties: {
|
|
17
|
+
message: { type: "string" },
|
|
18
|
+
user: { type: ["number", "null"] },
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default handler;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// B4:roles 出自 sys_user_role 权威源(users.roles JSON 列已被 0003 移除,D10)——
|
|
3
3
|
// 体验层角色走本资料接口,不进 JWT claims;avatar 读 avatar_base64,email 读 0007 迁移列。
|
|
4
4
|
// 响应一律走 json.ok/json.fail 信封(oj 红线)。
|
|
5
|
-
|
|
5
|
+
const handler = {
|
|
6
6
|
async get() {
|
|
7
7
|
const uid = http.user?.id;
|
|
8
8
|
if (!uid) {
|
|
@@ -35,3 +35,23 @@ export default {
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
|
+
|
|
39
|
+
// 出参:登录链用户资料(roles 出自 sys_user_role,permissions 预留恒空)
|
|
40
|
+
handler.get.response = {
|
|
41
|
+
type: "object",
|
|
42
|
+
required: ["id", "avatar", "username", "displayName", "email", "phoneNumber", "description", "roles", "mustChange", "permissions"],
|
|
43
|
+
properties: {
|
|
44
|
+
id: { type: "string" },
|
|
45
|
+
avatar: { type: "string" },
|
|
46
|
+
username: { type: "string" },
|
|
47
|
+
displayName: { type: "string" },
|
|
48
|
+
email: { type: "string" },
|
|
49
|
+
phoneNumber: { type: "string" },
|
|
50
|
+
description: { type: "string" },
|
|
51
|
+
roles: { type: "array", items: { type: "string" } },
|
|
52
|
+
mustChange: { type: "boolean" },
|
|
53
|
+
permissions: { type: "array", items: { type: "string" } },
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export default handler;
|
|
@@ -4,6 +4,29 @@
|
|
|
4
4
|
import { z } from "@oj-module/runtime";
|
|
5
5
|
|
|
6
6
|
export const schemas = {
|
|
7
|
+
"platformContactsGet": {
|
|
8
|
+
query: z.object({
|
|
9
|
+
"keyword": z.string().min(2),
|
|
10
|
+
"limit": z.number().optional()
|
|
11
|
+
}),
|
|
12
|
+
data: z.array(z.object({
|
|
13
|
+
"id": z.number(),
|
|
14
|
+
"username": z.string(),
|
|
15
|
+
"display_name": z.string().nullable()
|
|
16
|
+
})),
|
|
17
|
+
},
|
|
18
|
+
"platformContactsDetailGet": {
|
|
19
|
+
query: z.object({
|
|
20
|
+
"id": z.number()
|
|
21
|
+
}),
|
|
22
|
+
data: z.object({
|
|
23
|
+
"id": z.number(),
|
|
24
|
+
"username": z.string(),
|
|
25
|
+
"display_name": z.string().nullable(),
|
|
26
|
+
"email": z.string().nullable(),
|
|
27
|
+
"avatar_base64": z.string().nullable()
|
|
28
|
+
}),
|
|
29
|
+
},
|
|
7
30
|
"platformMarketInstallPost": {
|
|
8
31
|
body: z.object({
|
|
9
32
|
"source": z.enum(["cdn", "file"]),
|
|
@@ -101,19 +124,6 @@ export const schemas = {
|
|
|
101
124
|
data: z.array(z.object({
|
|
102
125
|
|
|
103
126
|
}).catchall(z.unknown())),
|
|
104
|
-
},
|
|
105
|
-
"platformOrgTreeGet": {
|
|
106
|
-
query: z.object({
|
|
107
|
-
"scope": z.enum(["self", "all"]).optional()
|
|
108
|
-
}),
|
|
109
|
-
data: z.array(z.object({
|
|
110
|
-
"id": z.number(),
|
|
111
|
-
"parentId": z.number().nullable(),
|
|
112
|
-
"name": z.string().nullable(),
|
|
113
|
-
"nameEn": z.string().nullable().optional(),
|
|
114
|
-
"orderNo": z.number(),
|
|
115
|
-
"memberCount": z.number()
|
|
116
|
-
})),
|
|
117
127
|
},
|
|
118
128
|
"platformOrgDepartmentsGet": {
|
|
119
129
|
query: z.object({
|
|
@@ -136,6 +146,16 @@ export const schemas = {
|
|
|
136
146
|
"page": z.number(),
|
|
137
147
|
"size": z.number(),
|
|
138
148
|
"truncated": z.boolean()
|
|
149
|
+
}),
|
|
150
|
+
},
|
|
151
|
+
"platformOrgIsMemberGet": {
|
|
152
|
+
query: z.object({
|
|
153
|
+
"scope": z.enum(["self", "all"]).optional(),
|
|
154
|
+
"uid": z.number().optional(),
|
|
155
|
+
"dept": z.number()
|
|
156
|
+
}),
|
|
157
|
+
data: z.object({
|
|
158
|
+
"isMember": z.boolean()
|
|
139
159
|
}),
|
|
140
160
|
},
|
|
141
161
|
"platformOrgMembersGet": {
|
|
@@ -160,24 +180,6 @@ export const schemas = {
|
|
|
160
180
|
"page": z.number(),
|
|
161
181
|
"size": z.number(),
|
|
162
182
|
"truncated": z.boolean()
|
|
163
|
-
}),
|
|
164
|
-
},
|
|
165
|
-
"platformOrgUserGet": {
|
|
166
|
-
query: z.object({
|
|
167
|
-
"scope": z.enum(["self", "all"]).optional(),
|
|
168
|
-
"uid": z.number().optional()
|
|
169
|
-
}),
|
|
170
|
-
data: z.object({
|
|
171
|
-
"userId": z.number(),
|
|
172
|
-
"username": z.string(),
|
|
173
|
-
"displayName": z.string().nullable().optional(),
|
|
174
|
-
"position": z.string().nullable(),
|
|
175
|
-
"mainDeptId": z.number().nullable(),
|
|
176
|
-
"mainDeptPath": z.array(z.string()),
|
|
177
|
-
"departments": z.array(z.object({
|
|
178
|
-
"deptId": z.number(),
|
|
179
|
-
"deptPath": z.array(z.string())
|
|
180
|
-
}))
|
|
181
183
|
}),
|
|
182
184
|
},
|
|
183
185
|
"platformOrgPickerGet": {
|
|
@@ -218,14 +220,76 @@ export const schemas = {
|
|
|
218
220
|
"userIds": z.array(z.number())
|
|
219
221
|
}),
|
|
220
222
|
},
|
|
221
|
-
"
|
|
223
|
+
"platformOrgTreeGet": {
|
|
224
|
+
query: z.object({
|
|
225
|
+
"scope": z.enum(["self", "all"]).optional()
|
|
226
|
+
}),
|
|
227
|
+
data: z.array(z.object({
|
|
228
|
+
"id": z.number(),
|
|
229
|
+
"parentId": z.number().nullable(),
|
|
230
|
+
"name": z.string().nullable(),
|
|
231
|
+
"nameEn": z.string().nullable().optional(),
|
|
232
|
+
"orderNo": z.number(),
|
|
233
|
+
"memberCount": z.number()
|
|
234
|
+
})),
|
|
235
|
+
},
|
|
236
|
+
"platformOrgUserGet": {
|
|
222
237
|
query: z.object({
|
|
223
238
|
"scope": z.enum(["self", "all"]).optional(),
|
|
224
|
-
"uid": z.number().optional()
|
|
225
|
-
"dept": z.number()
|
|
239
|
+
"uid": z.number().optional()
|
|
226
240
|
}),
|
|
227
241
|
data: z.object({
|
|
228
|
-
"
|
|
242
|
+
"userId": z.number(),
|
|
243
|
+
"username": z.string(),
|
|
244
|
+
"displayName": z.string().nullable().optional(),
|
|
245
|
+
"position": z.string().nullable(),
|
|
246
|
+
"mainDeptId": z.number().nullable(),
|
|
247
|
+
"mainDeptPath": z.array(z.string()),
|
|
248
|
+
"departments": z.array(z.object({
|
|
249
|
+
"deptId": z.number(),
|
|
250
|
+
"deptPath": z.array(z.string())
|
|
251
|
+
}))
|
|
252
|
+
}),
|
|
253
|
+
},
|
|
254
|
+
"platformSolutionsRoutesGet": {
|
|
255
|
+
data: z.array(z.object({
|
|
256
|
+
"path": z.string(),
|
|
257
|
+
"module": z.string(),
|
|
258
|
+
"category": z.enum(["main", "admin", "hidden"]),
|
|
259
|
+
"order": z.number(),
|
|
260
|
+
"title_key": z.string().nullable(),
|
|
261
|
+
"required_permission": z.string().nullable(),
|
|
262
|
+
"enabled": z.boolean()
|
|
263
|
+
})),
|
|
264
|
+
},
|
|
265
|
+
"platformSolutionsVerifyPost": {
|
|
266
|
+
query: z.object({
|
|
267
|
+
"name": z.string().min(1)
|
|
268
|
+
}),
|
|
269
|
+
data: z.object({
|
|
270
|
+
"ok": z.boolean(),
|
|
271
|
+
"checks": z.array(z.object({
|
|
272
|
+
"id": z.string(),
|
|
273
|
+
"severity": z.enum(["error", "warn", "info"]),
|
|
274
|
+
"subject": z.string(),
|
|
275
|
+
"advise_key": z.string()
|
|
276
|
+
})),
|
|
277
|
+
"advise": z.array(z.string())
|
|
278
|
+
}),
|
|
279
|
+
},
|
|
280
|
+
"platformSolutionsVerifyLastGet": {
|
|
281
|
+
query: z.object({
|
|
282
|
+
"name": z.string().min(1)
|
|
283
|
+
}),
|
|
284
|
+
data: z.object({
|
|
285
|
+
"ok": z.boolean(),
|
|
286
|
+
"checks": z.array(z.object({
|
|
287
|
+
"id": z.string(),
|
|
288
|
+
"severity": z.enum(["error", "warn", "info"]),
|
|
289
|
+
"subject": z.string(),
|
|
290
|
+
"advise_key": z.string()
|
|
291
|
+
})),
|
|
292
|
+
"advise": z.array(z.string())
|
|
229
293
|
}),
|
|
230
294
|
},
|
|
231
295
|
};
|
|
@@ -17,6 +17,9 @@ export const API_PREFIX = "/_platform";
|
|
|
17
17
|
/** 认领身份前缀(契约 apiPrefix,字面等于模块目录名):跨模块认领护栏对比基准 */
|
|
18
18
|
export const MODULE_PREFIX = "/_platform";
|
|
19
19
|
|
|
20
|
+
/** 认领方模块(web.config clientOwners 指定):跨模块认领护栏对比基准 */
|
|
21
|
+
export const MODULE_OWNER = "/app";
|
|
22
|
+
|
|
20
23
|
/**
|
|
21
24
|
* 模块 entry 的 onInit 里一行创建(构造即 install):完成 apiPrefix 登记 +
|
|
22
25
|
* scoped request 绑定,返回绑好前缀的端点函数集合。一模块一 client;
|
|
@@ -28,12 +31,12 @@ export function create_platformClient(ctx: ModuleContext) {
|
|
|
28
31
|
// 单槽、卸载互相耦合;跨模块需求应由本模块创建后经 provider 暴露。
|
|
29
32
|
// 注意对比基准是 MODULE_PREFIX(目录名)而非 API_PREFIX——D-M8 映射时线上前缀
|
|
30
33
|
// 属于别的命名空间,认领身份仍按目录名。
|
|
31
|
-
if (import.meta.env.DEV && ctx.module.name !==
|
|
32
|
-
console.warn(`[ojm-api] 模块 "${ctx.module.name}" 正在认领 ${MODULE_PREFIX} 的 client——跨模块认领会共享 request 单槽、卸载互相耦合;应由 "${
|
|
34
|
+
if (import.meta.env.DEV && ctx.module.name !== MODULE_OWNER.slice(1)) {
|
|
35
|
+
console.warn(`[ojm-api] 模块 "${ctx.module.name}" 正在认领 ${MODULE_PREFIX} 的 client——跨模块认领会共享 request 单槽、卸载互相耦合;应由 "${MODULE_OWNER.slice(1)}" 模块在自身 onInit 创建,跨模块需求经 provider 暴露。`);
|
|
33
36
|
}
|
|
34
37
|
ctx.register.apiPrefix(API_PREFIX);
|
|
35
38
|
bindRequest(ctx.utils.request);
|
|
36
|
-
return { platformContactsGet, platformContactsDetailGet, platformMarketInstallPost, platformMarketInstallCancelPost, platformMarketTaskGet, platformMarketEnablePost, platformMarketMetaGet, platformMarketTrustGet, platformMarketTrustPost, platformMarketTrustKeyPost, platformMarketTrustKeyDelete, platformMarketIndexGet, platformMarketUninstallImpactGet, platformMarketUninstallPost, platformMarketHistoryGet,
|
|
39
|
+
return { platformContactsGet, platformContactsDetailGet, platformMarketInstallPost, platformMarketInstallCancelPost, platformMarketTaskGet, platformMarketEnablePost, platformMarketMetaGet, platformMarketTrustGet, platformMarketTrustPost, platformMarketTrustKeyPost, platformMarketTrustKeyDelete, platformMarketIndexGet, platformMarketUninstallImpactGet, platformMarketUninstallPost, platformMarketHistoryGet, platformOrgDepartmentsGet, platformOrgIsMemberGet, platformOrgMembersGet, platformOrgPickerGet, platformOrgResolvePost, platformOrgTreeGet, platformOrgUserGet, platformSolutionsRoutesGet, platformSolutionsVerifyPost, platformSolutionsVerifyLastGet };
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
/**
|
|
@@ -64,14 +67,23 @@ async function toApiError(e: unknown): Promise<unknown> {
|
|
|
64
67
|
return e;
|
|
65
68
|
}
|
|
66
69
|
|
|
67
|
-
export
|
|
70
|
+
export type PlatformContactsGetQuery = z.input<(typeof schemas)["platformContactsGet"]["query"]>;
|
|
71
|
+
export type PlatformContactsGetData = z.infer<(typeof schemas)["platformContactsGet"]["data"]>;
|
|
72
|
+
|
|
73
|
+
export async function platformContactsGet(query: PlatformContactsGetQuery): Promise<PlatformContactsGetData> {
|
|
68
74
|
const client = ensureReq();
|
|
69
75
|
try {
|
|
70
|
-
const env = await client.get(`_platform/contacts
|
|
76
|
+
const env = await client.get(`_platform/contacts`, { searchParams: query as Record<string, string | number | boolean> }).json<OjEnvelope<PlatformContactsGetData>>();
|
|
71
77
|
// 2xx + code!==0 也是业务错误(§6.2 通道 a):oj 不会这么发,但契约机制的价值恰是防漂移
|
|
72
78
|
if (typeof env.code === "number" && env.code !== 0)
|
|
73
79
|
throw new ContractApiError(env.code, env.msg ?? "业务错误(信封 code 非 0)");
|
|
74
|
-
const data = env.data as
|
|
80
|
+
const data = env.data as PlatformContactsGetData;
|
|
81
|
+
if (import.meta.env.DEV) {
|
|
82
|
+
const { schemas } = await import("./api.schemas");
|
|
83
|
+
const r = schemas["platformContactsGet"].data.safeParse(data);
|
|
84
|
+
if (!r.success)
|
|
85
|
+
throw new ContractApiError(-1, `[契约违例] platformContactsGet 响应与契约不符:${r.error.issues.map(i => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
|
|
86
|
+
}
|
|
75
87
|
return data;
|
|
76
88
|
}
|
|
77
89
|
catch (e) {
|
|
@@ -79,14 +91,23 @@ export async function platformContactsGet(): Promise<unknown> {
|
|
|
79
91
|
}
|
|
80
92
|
}
|
|
81
93
|
|
|
82
|
-
export
|
|
94
|
+
export type PlatformContactsDetailGetQuery = z.input<(typeof schemas)["platformContactsDetailGet"]["query"]>;
|
|
95
|
+
export type PlatformContactsDetailGetData = z.infer<(typeof schemas)["platformContactsDetailGet"]["data"]>;
|
|
96
|
+
|
|
97
|
+
export async function platformContactsDetailGet(query: PlatformContactsDetailGetQuery): Promise<PlatformContactsDetailGetData> {
|
|
83
98
|
const client = ensureReq();
|
|
84
99
|
try {
|
|
85
|
-
const env = await client.get(`_platform/contacts/detail
|
|
100
|
+
const env = await client.get(`_platform/contacts/detail`, { searchParams: query as Record<string, string | number | boolean> }).json<OjEnvelope<PlatformContactsDetailGetData>>();
|
|
86
101
|
// 2xx + code!==0 也是业务错误(§6.2 通道 a):oj 不会这么发,但契约机制的价值恰是防漂移
|
|
87
102
|
if (typeof env.code === "number" && env.code !== 0)
|
|
88
103
|
throw new ContractApiError(env.code, env.msg ?? "业务错误(信封 code 非 0)");
|
|
89
|
-
const data = env.data as
|
|
104
|
+
const data = env.data as PlatformContactsDetailGetData;
|
|
105
|
+
if (import.meta.env.DEV) {
|
|
106
|
+
const { schemas } = await import("./api.schemas");
|
|
107
|
+
const r = schemas["platformContactsDetailGet"].data.safeParse(data);
|
|
108
|
+
if (!r.success)
|
|
109
|
+
throw new ContractApiError(-1, `[契约违例] platformContactsDetailGet 响应与契约不符:${r.error.issues.map(i => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
|
|
110
|
+
}
|
|
90
111
|
return data;
|
|
91
112
|
}
|
|
92
113
|
catch (e) {
|
|
@@ -402,14 +423,23 @@ export async function platformMarketHistoryGet(): Promise<PlatformMarketHistoryG
|
|
|
402
423
|
}
|
|
403
424
|
}
|
|
404
425
|
|
|
405
|
-
export
|
|
426
|
+
export type PlatformOrgDepartmentsGetQuery = z.input<(typeof schemas)["platformOrgDepartmentsGet"]["query"]>;
|
|
427
|
+
export type PlatformOrgDepartmentsGetData = z.infer<(typeof schemas)["platformOrgDepartmentsGet"]["data"]>;
|
|
428
|
+
|
|
429
|
+
export async function platformOrgDepartmentsGet(query: PlatformOrgDepartmentsGetQuery): Promise<PlatformOrgDepartmentsGetData> {
|
|
406
430
|
const client = ensureReq();
|
|
407
431
|
try {
|
|
408
|
-
const env = await client.get(`_platform/
|
|
432
|
+
const env = await client.get(`_platform/org/departments`, { searchParams: query as Record<string, string | number | boolean> }).json<OjEnvelope<PlatformOrgDepartmentsGetData>>();
|
|
409
433
|
// 2xx + code!==0 也是业务错误(§6.2 通道 a):oj 不会这么发,但契约机制的价值恰是防漂移
|
|
410
434
|
if (typeof env.code === "number" && env.code !== 0)
|
|
411
435
|
throw new ContractApiError(env.code, env.msg ?? "业务错误(信封 code 非 0)");
|
|
412
|
-
const data = env.data as
|
|
436
|
+
const data = env.data as PlatformOrgDepartmentsGetData;
|
|
437
|
+
if (import.meta.env.DEV) {
|
|
438
|
+
const { schemas } = await import("./api.schemas");
|
|
439
|
+
const r = schemas["platformOrgDepartmentsGet"].data.safeParse(data);
|
|
440
|
+
if (!r.success)
|
|
441
|
+
throw new ContractApiError(-1, `[契约违例] platformOrgDepartmentsGet 响应与契约不符:${r.error.issues.map(i => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
|
|
442
|
+
}
|
|
413
443
|
return data;
|
|
414
444
|
}
|
|
415
445
|
catch (e) {
|
|
@@ -417,14 +447,23 @@ export async function platformSolutionsRoutesGet(): Promise<unknown> {
|
|
|
417
447
|
}
|
|
418
448
|
}
|
|
419
449
|
|
|
420
|
-
export
|
|
450
|
+
export type PlatformOrgIsMemberGetQuery = z.input<(typeof schemas)["platformOrgIsMemberGet"]["query"]>;
|
|
451
|
+
export type PlatformOrgIsMemberGetData = z.infer<(typeof schemas)["platformOrgIsMemberGet"]["data"]>;
|
|
452
|
+
|
|
453
|
+
export async function platformOrgIsMemberGet(query: PlatformOrgIsMemberGetQuery): Promise<PlatformOrgIsMemberGetData> {
|
|
421
454
|
const client = ensureReq();
|
|
422
455
|
try {
|
|
423
|
-
const env = await client.
|
|
456
|
+
const env = await client.get(`_platform/org/is-member`, { searchParams: query as Record<string, string | number | boolean> }).json<OjEnvelope<PlatformOrgIsMemberGetData>>();
|
|
424
457
|
// 2xx + code!==0 也是业务错误(§6.2 通道 a):oj 不会这么发,但契约机制的价值恰是防漂移
|
|
425
458
|
if (typeof env.code === "number" && env.code !== 0)
|
|
426
459
|
throw new ContractApiError(env.code, env.msg ?? "业务错误(信封 code 非 0)");
|
|
427
|
-
const data = env.data as
|
|
460
|
+
const data = env.data as PlatformOrgIsMemberGetData;
|
|
461
|
+
if (import.meta.env.DEV) {
|
|
462
|
+
const { schemas } = await import("./api.schemas");
|
|
463
|
+
const r = schemas["platformOrgIsMemberGet"].data.safeParse(data);
|
|
464
|
+
if (!r.success)
|
|
465
|
+
throw new ContractApiError(-1, `[契约违例] platformOrgIsMemberGet 响应与契约不符:${r.error.issues.map(i => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
|
|
466
|
+
}
|
|
428
467
|
return data;
|
|
429
468
|
}
|
|
430
469
|
catch (e) {
|
|
@@ -432,14 +471,23 @@ export async function platformSolutionsVerifyPost(): Promise<unknown> {
|
|
|
432
471
|
}
|
|
433
472
|
}
|
|
434
473
|
|
|
435
|
-
export
|
|
474
|
+
export type PlatformOrgMembersGetQuery = z.input<(typeof schemas)["platformOrgMembersGet"]["query"]>;
|
|
475
|
+
export type PlatformOrgMembersGetData = z.infer<(typeof schemas)["platformOrgMembersGet"]["data"]>;
|
|
476
|
+
|
|
477
|
+
export async function platformOrgMembersGet(query: PlatformOrgMembersGetQuery): Promise<PlatformOrgMembersGetData> {
|
|
436
478
|
const client = ensureReq();
|
|
437
479
|
try {
|
|
438
|
-
const env = await client.get(`_platform/
|
|
480
|
+
const env = await client.get(`_platform/org/members`, { searchParams: query as Record<string, string | number | boolean> }).json<OjEnvelope<PlatformOrgMembersGetData>>();
|
|
439
481
|
// 2xx + code!==0 也是业务错误(§6.2 通道 a):oj 不会这么发,但契约机制的价值恰是防漂移
|
|
440
482
|
if (typeof env.code === "number" && env.code !== 0)
|
|
441
483
|
throw new ContractApiError(env.code, env.msg ?? "业务错误(信封 code 非 0)");
|
|
442
|
-
const data = env.data as
|
|
484
|
+
const data = env.data as PlatformOrgMembersGetData;
|
|
485
|
+
if (import.meta.env.DEV) {
|
|
486
|
+
const { schemas } = await import("./api.schemas");
|
|
487
|
+
const r = schemas["platformOrgMembersGet"].data.safeParse(data);
|
|
488
|
+
if (!r.success)
|
|
489
|
+
throw new ContractApiError(-1, `[契约违例] platformOrgMembersGet 响应与契约不符:${r.error.issues.map(i => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
|
|
490
|
+
}
|
|
443
491
|
return data;
|
|
444
492
|
}
|
|
445
493
|
catch (e) {
|
|
@@ -447,22 +495,22 @@ export async function platformSolutionsVerifyLastGet(): Promise<unknown> {
|
|
|
447
495
|
}
|
|
448
496
|
}
|
|
449
497
|
|
|
450
|
-
export type
|
|
451
|
-
export type
|
|
498
|
+
export type PlatformOrgPickerGetQuery = z.input<(typeof schemas)["platformOrgPickerGet"]["query"]>;
|
|
499
|
+
export type PlatformOrgPickerGetData = z.infer<(typeof schemas)["platformOrgPickerGet"]["data"]>;
|
|
452
500
|
|
|
453
|
-
export async function
|
|
501
|
+
export async function platformOrgPickerGet(query: PlatformOrgPickerGetQuery): Promise<PlatformOrgPickerGetData> {
|
|
454
502
|
const client = ensureReq();
|
|
455
503
|
try {
|
|
456
|
-
const env = await client.get(`_platform/org/
|
|
504
|
+
const env = await client.get(`_platform/org/picker`, { searchParams: query as Record<string, string | number | boolean> }).json<OjEnvelope<PlatformOrgPickerGetData>>();
|
|
457
505
|
// 2xx + code!==0 也是业务错误(§6.2 通道 a):oj 不会这么发,但契约机制的价值恰是防漂移
|
|
458
506
|
if (typeof env.code === "number" && env.code !== 0)
|
|
459
507
|
throw new ContractApiError(env.code, env.msg ?? "业务错误(信封 code 非 0)");
|
|
460
|
-
const data = env.data as
|
|
508
|
+
const data = env.data as PlatformOrgPickerGetData;
|
|
461
509
|
if (import.meta.env.DEV) {
|
|
462
510
|
const { schemas } = await import("./api.schemas");
|
|
463
|
-
const r = schemas["
|
|
511
|
+
const r = schemas["platformOrgPickerGet"].data.safeParse(data);
|
|
464
512
|
if (!r.success)
|
|
465
|
-
throw new ContractApiError(-1, `[契约违例]
|
|
513
|
+
throw new ContractApiError(-1, `[契约违例] platformOrgPickerGet 响应与契约不符:${r.error.issues.map(i => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
|
|
466
514
|
}
|
|
467
515
|
return data;
|
|
468
516
|
}
|
|
@@ -471,22 +519,23 @@ export async function platformOrgTreeGet(query: PlatformOrgTreeGetQuery): Promis
|
|
|
471
519
|
}
|
|
472
520
|
}
|
|
473
521
|
|
|
474
|
-
export type
|
|
475
|
-
export type
|
|
522
|
+
export type PlatformOrgResolvePostQuery = z.input<(typeof schemas)["platformOrgResolvePost"]["query"]>;
|
|
523
|
+
export type PlatformOrgResolvePostBody = z.input<(typeof schemas)["platformOrgResolvePost"]["body"]>;
|
|
524
|
+
export type PlatformOrgResolvePostData = z.infer<(typeof schemas)["platformOrgResolvePost"]["data"]>;
|
|
476
525
|
|
|
477
|
-
export async function
|
|
526
|
+
export async function platformOrgResolvePost(input: { query: PlatformOrgResolvePostQuery, body: PlatformOrgResolvePostBody }): Promise<PlatformOrgResolvePostData> {
|
|
478
527
|
const client = ensureReq();
|
|
479
528
|
try {
|
|
480
|
-
const env = await client.
|
|
529
|
+
const env = await client.post(`_platform/org/resolve`, { searchParams: input.query as Record<string, string | number | boolean>, json: input.body }).json<OjEnvelope<PlatformOrgResolvePostData>>();
|
|
481
530
|
// 2xx + code!==0 也是业务错误(§6.2 通道 a):oj 不会这么发,但契约机制的价值恰是防漂移
|
|
482
531
|
if (typeof env.code === "number" && env.code !== 0)
|
|
483
532
|
throw new ContractApiError(env.code, env.msg ?? "业务错误(信封 code 非 0)");
|
|
484
|
-
const data = env.data as
|
|
533
|
+
const data = env.data as PlatformOrgResolvePostData;
|
|
485
534
|
if (import.meta.env.DEV) {
|
|
486
535
|
const { schemas } = await import("./api.schemas");
|
|
487
|
-
const r = schemas["
|
|
536
|
+
const r = schemas["platformOrgResolvePost"].data.safeParse(data);
|
|
488
537
|
if (!r.success)
|
|
489
|
-
throw new ContractApiError(-1, `[契约违例]
|
|
538
|
+
throw new ContractApiError(-1, `[契约违例] platformOrgResolvePost 响应与契约不符:${r.error.issues.map(i => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
|
|
490
539
|
}
|
|
491
540
|
return data;
|
|
492
541
|
}
|
|
@@ -495,22 +544,22 @@ export async function platformOrgDepartmentsGet(query: PlatformOrgDepartmentsGet
|
|
|
495
544
|
}
|
|
496
545
|
}
|
|
497
546
|
|
|
498
|
-
export type
|
|
499
|
-
export type
|
|
547
|
+
export type PlatformOrgTreeGetQuery = z.input<(typeof schemas)["platformOrgTreeGet"]["query"]>;
|
|
548
|
+
export type PlatformOrgTreeGetData = z.infer<(typeof schemas)["platformOrgTreeGet"]["data"]>;
|
|
500
549
|
|
|
501
|
-
export async function
|
|
550
|
+
export async function platformOrgTreeGet(query: PlatformOrgTreeGetQuery): Promise<PlatformOrgTreeGetData> {
|
|
502
551
|
const client = ensureReq();
|
|
503
552
|
try {
|
|
504
|
-
const env = await client.get(`_platform/org/
|
|
553
|
+
const env = await client.get(`_platform/org/tree`, { searchParams: query as Record<string, string | number | boolean> }).json<OjEnvelope<PlatformOrgTreeGetData>>();
|
|
505
554
|
// 2xx + code!==0 也是业务错误(§6.2 通道 a):oj 不会这么发,但契约机制的价值恰是防漂移
|
|
506
555
|
if (typeof env.code === "number" && env.code !== 0)
|
|
507
556
|
throw new ContractApiError(env.code, env.msg ?? "业务错误(信封 code 非 0)");
|
|
508
|
-
const data = env.data as
|
|
557
|
+
const data = env.data as PlatformOrgTreeGetData;
|
|
509
558
|
if (import.meta.env.DEV) {
|
|
510
559
|
const { schemas } = await import("./api.schemas");
|
|
511
|
-
const r = schemas["
|
|
560
|
+
const r = schemas["platformOrgTreeGet"].data.safeParse(data);
|
|
512
561
|
if (!r.success)
|
|
513
|
-
throw new ContractApiError(-1, `[契约违例]
|
|
562
|
+
throw new ContractApiError(-1, `[契约违例] platformOrgTreeGet 响应与契约不符:${r.error.issues.map(i => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
|
|
514
563
|
}
|
|
515
564
|
return data;
|
|
516
565
|
}
|
|
@@ -543,22 +592,21 @@ export async function platformOrgUserGet(query: PlatformOrgUserGetQuery): Promis
|
|
|
543
592
|
}
|
|
544
593
|
}
|
|
545
594
|
|
|
546
|
-
export type
|
|
547
|
-
export type PlatformOrgPickerGetData = z.infer<(typeof schemas)["platformOrgPickerGet"]["data"]>;
|
|
595
|
+
export type PlatformSolutionsRoutesGetData = z.infer<(typeof schemas)["platformSolutionsRoutesGet"]["data"]>;
|
|
548
596
|
|
|
549
|
-
export async function
|
|
597
|
+
export async function platformSolutionsRoutesGet(): Promise<PlatformSolutionsRoutesGetData> {
|
|
550
598
|
const client = ensureReq();
|
|
551
599
|
try {
|
|
552
|
-
const env = await client.get(`_platform/
|
|
600
|
+
const env = await client.get(`_platform/solutions/routes`).json<OjEnvelope<PlatformSolutionsRoutesGetData>>();
|
|
553
601
|
// 2xx + code!==0 也是业务错误(§6.2 通道 a):oj 不会这么发,但契约机制的价值恰是防漂移
|
|
554
602
|
if (typeof env.code === "number" && env.code !== 0)
|
|
555
603
|
throw new ContractApiError(env.code, env.msg ?? "业务错误(信封 code 非 0)");
|
|
556
|
-
const data = env.data as
|
|
604
|
+
const data = env.data as PlatformSolutionsRoutesGetData;
|
|
557
605
|
if (import.meta.env.DEV) {
|
|
558
606
|
const { schemas } = await import("./api.schemas");
|
|
559
|
-
const r = schemas["
|
|
607
|
+
const r = schemas["platformSolutionsRoutesGet"].data.safeParse(data);
|
|
560
608
|
if (!r.success)
|
|
561
|
-
throw new ContractApiError(-1, `[契约违例]
|
|
609
|
+
throw new ContractApiError(-1, `[契约违例] platformSolutionsRoutesGet 响应与契约不符:${r.error.issues.map(i => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
|
|
562
610
|
}
|
|
563
611
|
return data;
|
|
564
612
|
}
|
|
@@ -567,23 +615,22 @@ export async function platformOrgPickerGet(query: PlatformOrgPickerGetQuery): Pr
|
|
|
567
615
|
}
|
|
568
616
|
}
|
|
569
617
|
|
|
570
|
-
export type
|
|
571
|
-
export type
|
|
572
|
-
export type PlatformOrgResolvePostData = z.infer<(typeof schemas)["platformOrgResolvePost"]["data"]>;
|
|
618
|
+
export type PlatformSolutionsVerifyPostQuery = z.input<(typeof schemas)["platformSolutionsVerifyPost"]["query"]>;
|
|
619
|
+
export type PlatformSolutionsVerifyPostData = z.infer<(typeof schemas)["platformSolutionsVerifyPost"]["data"]>;
|
|
573
620
|
|
|
574
|
-
export async function
|
|
621
|
+
export async function platformSolutionsVerifyPost(query: PlatformSolutionsVerifyPostQuery): Promise<PlatformSolutionsVerifyPostData> {
|
|
575
622
|
const client = ensureReq();
|
|
576
623
|
try {
|
|
577
|
-
const env = await client.post(`_platform/
|
|
624
|
+
const env = await client.post(`_platform/solutions/verify`, { searchParams: query as Record<string, string | number | boolean> }).json<OjEnvelope<PlatformSolutionsVerifyPostData>>();
|
|
578
625
|
// 2xx + code!==0 也是业务错误(§6.2 通道 a):oj 不会这么发,但契约机制的价值恰是防漂移
|
|
579
626
|
if (typeof env.code === "number" && env.code !== 0)
|
|
580
627
|
throw new ContractApiError(env.code, env.msg ?? "业务错误(信封 code 非 0)");
|
|
581
|
-
const data = env.data as
|
|
628
|
+
const data = env.data as PlatformSolutionsVerifyPostData;
|
|
582
629
|
if (import.meta.env.DEV) {
|
|
583
630
|
const { schemas } = await import("./api.schemas");
|
|
584
|
-
const r = schemas["
|
|
631
|
+
const r = schemas["platformSolutionsVerifyPost"].data.safeParse(data);
|
|
585
632
|
if (!r.success)
|
|
586
|
-
throw new ContractApiError(-1, `[契约违例]
|
|
633
|
+
throw new ContractApiError(-1, `[契约违例] platformSolutionsVerifyPost 响应与契约不符:${r.error.issues.map(i => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
|
|
587
634
|
}
|
|
588
635
|
return data;
|
|
589
636
|
}
|
|
@@ -592,22 +639,22 @@ export async function platformOrgResolvePost(input: { query: PlatformOrgResolveP
|
|
|
592
639
|
}
|
|
593
640
|
}
|
|
594
641
|
|
|
595
|
-
export type
|
|
596
|
-
export type
|
|
642
|
+
export type PlatformSolutionsVerifyLastGetQuery = z.input<(typeof schemas)["platformSolutionsVerifyLastGet"]["query"]>;
|
|
643
|
+
export type PlatformSolutionsVerifyLastGetData = z.infer<(typeof schemas)["platformSolutionsVerifyLastGet"]["data"]>;
|
|
597
644
|
|
|
598
|
-
export async function
|
|
645
|
+
export async function platformSolutionsVerifyLastGet(query: PlatformSolutionsVerifyLastGetQuery): Promise<PlatformSolutionsVerifyLastGetData> {
|
|
599
646
|
const client = ensureReq();
|
|
600
647
|
try {
|
|
601
|
-
const env = await client.get(`_platform/
|
|
648
|
+
const env = await client.get(`_platform/solutions/verify/last`, { searchParams: query as Record<string, string | number | boolean> }).json<OjEnvelope<PlatformSolutionsVerifyLastGetData>>();
|
|
602
649
|
// 2xx + code!==0 也是业务错误(§6.2 通道 a):oj 不会这么发,但契约机制的价值恰是防漂移
|
|
603
650
|
if (typeof env.code === "number" && env.code !== 0)
|
|
604
651
|
throw new ContractApiError(env.code, env.msg ?? "业务错误(信封 code 非 0)");
|
|
605
|
-
const data = env.data as
|
|
652
|
+
const data = env.data as PlatformSolutionsVerifyLastGetData;
|
|
606
653
|
if (import.meta.env.DEV) {
|
|
607
654
|
const { schemas } = await import("./api.schemas");
|
|
608
|
-
const r = schemas["
|
|
655
|
+
const r = schemas["platformSolutionsVerifyLastGet"].data.safeParse(data);
|
|
609
656
|
if (!r.success)
|
|
610
|
-
throw new ContractApiError(-1, `[契约违例]
|
|
657
|
+
throw new ContractApiError(-1, `[契约违例] platformSolutionsVerifyLastGet 响应与契约不符:${r.error.issues.map(i => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ")}`);
|
|
611
658
|
}
|
|
612
659
|
return data;
|
|
613
660
|
}
|