@origen-ui/admin-cli 1.0.3 → 2.0.1

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 (237) hide show
  1. package/README.md +11 -7
  2. package/package.json +19 -3
  3. package/templates/current/clean/CHANGELOG.md +137 -0
  4. package/templates/current/clean/component-catalog.json +58 -17
  5. package/templates/current/clean/e2e/admin-shell.spec.ts +6 -0
  6. package/templates/current/clean/e2e/demo-shell.spec.ts +90 -46
  7. package/templates/current/clean/package.json +55 -41
  8. package/templates/current/clean/playwright.config.ts +1 -0
  9. package/templates/current/clean/playwright.demo.config.ts +1 -1
  10. package/templates/current/clean/scaffold.lock.json +2 -2
  11. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +7 -2
  12. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +7 -2
  13. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +7 -2
  14. package/templates/current/clean/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +11 -2
  15. package/templates/current/clean/scripts/clean-overlay/src/main.ts +23 -14
  16. package/templates/current/clean/scripts/clean-overlay/src/router/componentCache.ts +12 -0
  17. package/templates/current/clean/scripts/clean-overlay/src/router/componentRegistry.ts +2 -13
  18. package/templates/current/clean/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +34 -4
  19. package/templates/current/clean/scripts/clean-overlay/src/router/paths.ts +21 -0
  20. package/templates/current/clean/scripts/clean-overlay/src/router/staticRoutes.ts +6 -6
  21. package/templates/current/clean/scripts/demo-api.ts +84 -8
  22. package/templates/current/clean/scripts/generate-api.ts +87 -3
  23. package/templates/current/clean/scripts/vite-build-policy.spec.ts +72 -0
  24. package/templates/current/clean/src/App.vue +10 -3
  25. package/templates/current/clean/src/api/client.ts +90 -10
  26. package/templates/current/clean/src/api/generated/data-contracts.ts +0 -3
  27. package/templates/current/clean/src/api/generated/http-client.ts +28 -26
  28. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +5 -8
  29. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +1 -4
  30. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +2 -5
  31. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +6 -9
  32. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +7 -10
  33. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +6 -9
  34. package/templates/current/clean/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +6 -9
  35. package/templates/current/clean/src/api/generated//350/256/244/350/257/201.ts +3 -6
  36. package/templates/current/clean/src/app/adminLocale.ts +90 -0
  37. package/templates/current/clean/src/app/createAdminUi.spec.ts +65 -9
  38. package/templates/current/clean/src/app/createAdminUi.ts +14 -29
  39. package/templates/current/clean/src/app/embedded-token.spec.ts +40 -0
  40. package/templates/current/clean/src/app/embedded.spec.ts +135 -0
  41. package/templates/current/clean/src/app/embedded.ts +255 -0
  42. package/templates/current/clean/src/app/errorMessage.spec.ts +76 -0
  43. package/templates/current/clean/src/app/errorMessage.ts +53 -0
  44. package/templates/current/clean/src/app/localeFormat.ts +52 -0
  45. package/templates/current/clean/src/app/menu-host.spec.ts +77 -0
  46. package/templates/current/clean/src/app/menu.spec.ts +65 -0
  47. package/templates/current/clean/src/app/menu.ts +52 -12
  48. package/templates/current/clean/src/app/menuTypes.ts +1 -0
  49. package/templates/current/clean/src/app/origenUiLocale.spec.ts +6 -5
  50. package/templates/current/clean/src/app/origenUiLocale.ts +3 -58
  51. package/templates/current/clean/src/app/permission.spec.ts +26 -0
  52. package/templates/current/clean/src/app/runtimeConfig.ts +9 -8
  53. package/templates/current/clean/src/demo-api.spec.ts +311 -0
  54. package/templates/current/clean/src/env.d.ts +18 -0
  55. package/templates/current/clean/src/features/appearance/components/ThemePanel.vue +21 -17
  56. package/templates/current/clean/src/features/appearance/store/theme.ts +2 -1
  57. package/templates/current/clean/src/features/auth/pages/Login.vue +22 -12
  58. package/templates/current/clean/src/features/auth/store/auth.ts +6 -9
  59. package/templates/current/clean/src/features/errors/pages/Forbidden.vue +7 -2
  60. package/templates/current/clean/src/features/errors/pages/NotFound.vue +7 -2
  61. package/templates/current/clean/src/features/errors/pages/ServerError.vue +7 -2
  62. package/templates/current/clean/src/features/errors/pages/error-pages.spec.ts +11 -2
  63. package/templates/current/clean/src/features/security/components/DevtoolsProtectionOverlay.vue +5 -2
  64. package/templates/current/clean/src/features/security/devtoolsProtection.spec.ts +7 -10
  65. package/templates/current/clean/src/features/security/devtoolsProtection.ts +2 -1
  66. package/templates/current/clean/src/features/system/access/api/admin-repository.spec.ts +14 -0
  67. package/templates/current/clean/src/features/system/access/api/admin-repository.ts +34 -15
  68. package/templates/current/clean/src/features/system/access/api/rbac.ts +52 -32
  69. package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.spec.ts +134 -0
  70. package/templates/current/clean/src/features/system/access/composables/useAuthorizationPolling.ts +96 -0
  71. package/templates/current/clean/src/features/workspace/pages/Empty.vue +4 -1
  72. package/templates/current/clean/src/features/workspace/pages/Profile.vue +14 -12
  73. package/templates/current/clean/src/layouts/AdminLayout.vue +6 -1
  74. package/templates/current/clean/src/layouts/TopBar.vue +60 -11
  75. package/templates/current/clean/src/layouts/topBarMenuSearch.spec.ts +24 -1
  76. package/templates/current/clean/src/layouts/topBarMenuSearch.ts +10 -0
  77. package/templates/current/clean/src/locales/en-US.json +517 -0
  78. package/templates/current/clean/src/locales/en-US.runtime.ts +22 -0
  79. package/templates/current/clean/src/locales/index.ts +144 -47
  80. package/templates/current/clean/src/locales/messages-types.ts +62 -0
  81. package/templates/current/clean/src/locales/messages.spec.ts +113 -6
  82. package/templates/current/clean/src/locales/vue-i18n.d.ts +5 -0
  83. package/templates/current/clean/src/locales/zh-CN.json +517 -0
  84. package/templates/current/clean/src/locales/zh-CN.runtime.ts +22 -0
  85. package/templates/current/clean/src/locales/zh-TW.json +517 -0
  86. package/templates/current/clean/src/locales/zh-TW.runtime.ts +22 -0
  87. package/templates/current/clean/src/main.ts +23 -14
  88. package/templates/current/clean/src/router/bootstrap.ts +20 -11
  89. package/templates/current/clean/src/router/componentCache.ts +12 -0
  90. package/templates/current/clean/src/router/componentRegistry.ts +2 -13
  91. package/templates/current/clean/src/router/dynamicMenuRefresh.spec.ts +101 -0
  92. package/templates/current/clean/src/router/dynamicMenuRefresh.ts +24 -0
  93. package/templates/current/clean/src/router/dynamicRoutes.spec.ts +34 -4
  94. package/templates/current/clean/src/router/dynamicRoutes.ts +19 -4
  95. package/templates/current/clean/src/router/paths.spec.ts +50 -0
  96. package/templates/current/clean/src/router/paths.ts +21 -0
  97. package/templates/current/clean/src/router/queryEncryption.spec.ts +30 -4
  98. package/templates/current/clean/src/router/queryEncryption.ts +48 -44
  99. package/templates/current/clean/src/router/staticRoutes.ts +6 -6
  100. package/templates/current/clean/src/router/useRouteQueryDefaults.spec.ts +2 -1
  101. package/templates/current/clean/src/router/useRouteQueryDefaults.types.ts +2 -1
  102. package/templates/current/clean/src/templates/og-table.ts +79 -37
  103. package/templates/current/clean/src/templates/templates.spec.ts +19 -0
  104. package/templates/current/clean/tsconfig.json +0 -1
  105. package/templates/current/clean/vite.build-policy.ts +161 -289
  106. package/templates/current/clean/vite.config.ts +34 -5
  107. package/templates/current/examples/CHANGELOG.md +137 -0
  108. package/templates/current/examples/component-catalog.json +58 -17
  109. package/templates/current/examples/e2e/admin-shell.spec.ts +6 -0
  110. package/templates/current/examples/e2e/demo-shell.spec.ts +90 -46
  111. package/templates/current/examples/package.json +55 -41
  112. package/templates/current/examples/playwright.config.ts +1 -0
  113. package/templates/current/examples/playwright.demo.config.ts +1 -1
  114. package/templates/current/examples/scaffold.lock.json +2 -2
  115. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/Forbidden.vue +7 -2
  116. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/NotFound.vue +7 -2
  117. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/ServerError.vue +7 -2
  118. package/templates/current/examples/scripts/clean-overlay/src/features/errors/pages/error-pages.spec.ts +11 -2
  119. package/templates/current/examples/scripts/clean-overlay/src/main.ts +23 -14
  120. package/templates/current/examples/scripts/clean-overlay/src/router/componentCache.ts +12 -0
  121. package/templates/current/examples/scripts/clean-overlay/src/router/componentRegistry.ts +2 -13
  122. package/templates/current/examples/scripts/clean-overlay/src/router/dynamicRoutes.spec.ts +34 -4
  123. package/templates/current/examples/scripts/clean-overlay/src/router/paths.ts +21 -0
  124. package/templates/current/examples/scripts/clean-overlay/src/router/staticRoutes.ts +6 -6
  125. package/templates/current/examples/scripts/demo-api.ts +84 -8
  126. package/templates/current/examples/scripts/generate-api.ts +87 -3
  127. package/templates/current/examples/scripts/vite-build-policy.spec.ts +72 -0
  128. package/templates/current/examples/src/App.vue +10 -3
  129. package/templates/current/examples/src/api/client.ts +90 -10
  130. package/templates/current/examples/src/api/generated/data-contracts.ts +0 -3
  131. package/templates/current/examples/src/api/generated/http-client.ts +28 -26
  132. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/206/205/345/256/271/346/226/207/347/253/240.ts +5 -8
  133. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/345/256/241/350/256/241.ts +1 -4
  134. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/346/226/207/344/273/266/344/270/212/344/274/240.ts +2 -5
  135. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/347/224/250/346/210/267.ts +6 -9
  136. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/217/234/345/215/225.ts +7 -10
  137. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/247/222/350/211/262.ts +6 -9
  138. package/templates/current/examples/src/api/generated//347/263/273/347/273/237/347/256/241/347/220/206/350/256/242/345/215/225/350/215/211/347/250/277.ts +6 -9
  139. package/templates/current/examples/src/api/generated//350/256/244/350/257/201.ts +3 -6
  140. package/templates/current/examples/src/app/adminLocale.ts +90 -0
  141. package/templates/current/examples/src/app/createAdminUi.spec.ts +65 -9
  142. package/templates/current/examples/src/app/createAdminUi.ts +14 -29
  143. package/templates/current/examples/src/app/embedded-token.spec.ts +40 -0
  144. package/templates/current/examples/src/app/embedded.spec.ts +135 -0
  145. package/templates/current/examples/src/app/embedded.ts +255 -0
  146. package/templates/current/examples/src/app/errorMessage.spec.ts +76 -0
  147. package/templates/current/examples/src/app/errorMessage.ts +53 -0
  148. package/templates/current/examples/src/app/localeFormat.ts +52 -0
  149. package/templates/current/examples/src/app/menu-host.spec.ts +77 -0
  150. package/templates/current/examples/src/app/menu.spec.ts +65 -0
  151. package/templates/current/examples/src/app/menu.ts +52 -12
  152. package/templates/current/examples/src/app/menuTypes.ts +1 -0
  153. package/templates/current/examples/src/app/origenUiLocale.spec.ts +6 -5
  154. package/templates/current/examples/src/app/origenUiLocale.ts +3 -58
  155. package/templates/current/examples/src/app/permission.spec.ts +26 -0
  156. package/templates/current/examples/src/app/runtimeConfig.ts +9 -8
  157. package/templates/current/examples/src/demo-api.spec.ts +311 -0
  158. package/templates/current/examples/src/env.d.ts +18 -0
  159. package/templates/current/examples/src/features/appearance/components/ThemePanel.vue +21 -17
  160. package/templates/current/examples/src/features/appearance/store/theme.ts +2 -1
  161. package/templates/current/examples/src/features/auth/pages/Login.vue +22 -12
  162. package/templates/current/examples/src/features/auth/store/auth.ts +6 -9
  163. package/templates/current/examples/src/features/errors/pages/Forbidden.vue +7 -2
  164. package/templates/current/examples/src/features/errors/pages/NotFound.vue +7 -2
  165. package/templates/current/examples/src/features/errors/pages/ServerError.vue +7 -2
  166. package/templates/current/examples/src/features/errors/pages/error-pages.spec.ts +9 -1
  167. package/templates/current/examples/src/features/feature-composables.spec.ts +47 -10
  168. package/templates/current/examples/src/features/security/components/DevtoolsProtectionOverlay.vue +5 -2
  169. package/templates/current/examples/src/features/security/devtoolsProtection.spec.ts +7 -10
  170. package/templates/current/examples/src/features/security/devtoolsProtection.ts +2 -1
  171. package/templates/current/examples/src/features/system/access/api/admin-repository.spec.ts +14 -0
  172. package/templates/current/examples/src/features/system/access/api/admin-repository.ts +34 -15
  173. package/templates/current/examples/src/features/system/access/api/rbac.ts +52 -32
  174. package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.spec.ts +134 -0
  175. package/templates/current/examples/src/features/system/access/composables/useAuthorizationPolling.ts +96 -0
  176. package/templates/current/examples/src/features/system/audit/composables/useAuditManagement.ts +43 -38
  177. package/templates/current/examples/src/features/system/menus/components/MenuEditorForm.vue +137 -47
  178. package/templates/current/examples/src/features/system/menus/composables/useMenuManagement.ts +215 -107
  179. package/templates/current/examples/src/features/system/menus/menuDraft.spec.ts +204 -0
  180. package/templates/current/examples/src/features/system/menus/menuDraft.ts +116 -0
  181. package/templates/current/examples/src/features/system/menus/menuTreePrecheck.spec.ts +268 -0
  182. package/templates/current/examples/src/features/system/menus/menuTreePrecheck.ts +317 -0
  183. package/templates/current/examples/src/features/system/menus/pages/MenuList.vue +3 -1
  184. package/templates/current/examples/src/features/system/roles/components/RoleEditorForm.vue +19 -15
  185. package/templates/current/examples/src/features/system/roles/composables/useRoleManagement.ts +49 -53
  186. package/templates/current/examples/src/features/system/roles/pages/RoleList.vue +3 -1
  187. package/templates/current/examples/src/features/system/users/components/UserEditorForm.vue +22 -19
  188. package/templates/current/examples/src/features/system/users/composables/useUserManagement.ts +59 -64
  189. package/templates/current/examples/src/features/system/users/pages/UserList.vue +3 -1
  190. package/templates/current/examples/src/features/workspace/pages/Dashboard.spec.ts +9 -0
  191. package/templates/current/examples/src/features/workspace/pages/Dashboard.vue +54 -26
  192. package/templates/current/examples/src/features/workspace/pages/Empty.vue +4 -1
  193. package/templates/current/examples/src/features/workspace/pages/Profile.vue +14 -12
  194. package/templates/current/examples/src/layouts/AdminLayout.vue +6 -1
  195. package/templates/current/examples/src/layouts/TopBar.vue +60 -11
  196. package/templates/current/examples/src/layouts/topBarMenuSearch.spec.ts +24 -1
  197. package/templates/current/examples/src/layouts/topBarMenuSearch.ts +10 -0
  198. package/templates/current/examples/src/locales/en-US.json +517 -0
  199. package/templates/current/examples/src/locales/en-US.runtime.ts +22 -0
  200. package/templates/current/examples/src/locales/index.ts +144 -47
  201. package/templates/current/examples/src/locales/messages-types.ts +62 -0
  202. package/templates/current/examples/src/locales/messages.spec.ts +113 -6
  203. package/templates/current/examples/src/locales/vue-i18n.d.ts +5 -0
  204. package/templates/current/examples/src/locales/zh-CN.json +517 -0
  205. package/templates/current/examples/src/locales/zh-CN.runtime.ts +22 -0
  206. package/templates/current/examples/src/locales/zh-TW.json +517 -0
  207. package/templates/current/examples/src/locales/zh-TW.runtime.ts +22 -0
  208. package/templates/current/examples/src/main.ts +43 -15
  209. package/templates/current/examples/src/router/bootstrap.ts +20 -11
  210. package/templates/current/examples/src/router/componentCache.ts +18 -0
  211. package/templates/current/examples/src/router/componentRegistry.ts +1 -18
  212. package/templates/current/examples/src/router/dynamicMenuRefresh.spec.ts +101 -0
  213. package/templates/current/examples/src/router/dynamicMenuRefresh.ts +24 -0
  214. package/templates/current/examples/src/router/dynamicRoutes.spec.ts +37 -2
  215. package/templates/current/examples/src/router/dynamicRoutes.ts +19 -4
  216. package/templates/current/examples/src/router/paths.spec.ts +50 -0
  217. package/templates/current/examples/src/router/paths.ts +21 -0
  218. package/templates/current/examples/src/router/queryEncryption.spec.ts +30 -4
  219. package/templates/current/examples/src/router/queryEncryption.ts +48 -44
  220. package/templates/current/examples/src/router/staticRoutes.ts +4 -4
  221. package/templates/current/examples/src/router/useRouteQueryDefaults.spec.ts +2 -1
  222. package/templates/current/examples/src/router/useRouteQueryDefaults.types.ts +2 -1
  223. package/templates/current/examples/src/templates/og-table.ts +79 -37
  224. package/templates/current/examples/src/templates/templates.spec.ts +19 -0
  225. package/templates/current/examples/tsconfig.json +0 -1
  226. package/templates/current/examples/vite.build-policy.ts +161 -289
  227. package/templates/current/examples/vite.config.ts +34 -5
  228. package/templates/current/clean/scripts/check-admin-bundle.mjs +0 -214
  229. package/templates/current/clean/scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json +0 -38
  230. package/templates/current/clean/src/locales/en-US.ts +0 -55
  231. package/templates/current/clean/src/locales/zh-CN.ts +0 -55
  232. package/templates/current/clean/src/locales/zh-TW.ts +0 -44
  233. package/templates/current/examples/scripts/check-admin-bundle.mjs +0 -214
  234. package/templates/current/examples/scripts/performance/baselines/bundle-gzip-v2-pre-entry-unification.json +0 -38
  235. package/templates/current/examples/src/locales/en-US.ts +0 -55
  236. package/templates/current/examples/src/locales/zh-CN.ts +0 -55
  237. package/templates/current/examples/src/locales/zh-TW.ts +0 -44
@@ -1,6 +1,3 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- // @ts-nocheck
4
1
  /*
5
2
  * ---------------------------------------------------------------
6
3
  * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
@@ -10,7 +7,7 @@
10
7
  * ---------------------------------------------------------------
11
8
  */
12
9
 
13
- export type QueryParamsType = Record<string | number, any>;
10
+ export type QueryParamsType = Record<string | number, unknown>;
14
11
  export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
15
12
 
16
13
  export interface FullRequestParams extends Omit<RequestInit, "body"> {
@@ -62,6 +59,10 @@ export enum ContentType {
62
59
  Text = "text/plain",
63
60
  }
64
61
 
62
+ function isRecord(value: unknown): value is Record<string, unknown> {
63
+ return typeof value === "object" && value !== null;
64
+ }
65
+
65
66
  export class HttpClient<SecurityDataType = unknown> {
66
67
  public baseUrl: string = "/api";
67
68
  private securityData: SecurityDataType | null = null;
@@ -85,7 +86,7 @@ export class HttpClient<SecurityDataType = unknown> {
85
86
  this.securityData = data;
86
87
  };
87
88
 
88
- protected encodeQueryParam(key: string, value: any) {
89
+ protected encodeQueryParam(key: string, value: unknown) {
89
90
  const encodedKey = encodeURIComponent(key);
90
91
  return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`;
91
92
  }
@@ -96,7 +97,8 @@ export class HttpClient<SecurityDataType = unknown> {
96
97
 
97
98
  protected addArrayQueryParam(query: QueryParamsType, key: string) {
98
99
  const value = query[key];
99
- return value.map((v: any) => this.encodeQueryParam(key, v)).join("&");
100
+ if (!Array.isArray(value)) return "";
101
+ return value.map((v) => this.encodeQueryParam(key, v)).join("&");
100
102
  }
101
103
 
102
104
  protected toQueryString(rawQuery?: QueryParamsType): string {
@@ -118,38 +120,38 @@ export class HttpClient<SecurityDataType = unknown> {
118
120
  return queryString ? `?${queryString}` : "";
119
121
  }
120
122
 
121
- private contentFormatters: Record<ContentType, (input: any) => any> = {
122
- [ContentType.Json]: (input: any) =>
123
- input !== null && (typeof input === "object" || typeof input === "string")
124
- ? JSON.stringify(input)
125
- : input,
126
- [ContentType.JsonApi]: (input: any) =>
127
- input !== null && (typeof input === "object" || typeof input === "string")
128
- ? JSON.stringify(input)
129
- : input,
130
- [ContentType.Text]: (input: any) =>
131
- input !== null && typeof input !== "string"
132
- ? JSON.stringify(input)
133
- : input,
134
- [ContentType.FormData]: (input: any) => {
123
+ private contentFormatters: Record<ContentType, (input: unknown) => BodyInit | null> = {
124
+ [ContentType.Json]: (input: unknown) =>
125
+ input === null || typeof input === "undefined"
126
+ ? null
127
+ : JSON.stringify(input) ?? null,
128
+ [ContentType.JsonApi]: (input: unknown) =>
129
+ input === null || typeof input === "undefined"
130
+ ? null
131
+ : JSON.stringify(input) ?? null,
132
+ [ContentType.Text]: (input: unknown) =>
133
+ typeof input === "string" ? input : JSON.stringify(input) ?? null,
134
+ [ContentType.FormData]: (input: unknown) => {
135
135
  if (input instanceof FormData) {
136
136
  return input;
137
137
  }
138
138
 
139
- return Object.keys(input || {}).reduce((formData, key) => {
140
- const property = input[key];
139
+ const record = isRecord(input) ? input : {};
140
+ return Object.keys(record).reduce((formData, key) => {
141
+ const property = record[key];
141
142
  formData.append(
142
143
  key,
143
144
  property instanceof Blob
144
145
  ? property
145
146
  : typeof property === "object" && property !== null
146
- ? JSON.stringify(property)
147
- : `${property}`,
147
+ ? JSON.stringify(property) ?? ""
148
+ : String(property),
148
149
  );
149
150
  return formData;
150
151
  }, new FormData());
151
152
  },
152
- [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input),
153
+ [ContentType.UrlEncoded]: (input: unknown) =>
154
+ this.toQueryString(isRecord(input) ? input : {}),
153
155
  };
154
156
 
155
157
  protected mergeRequestParams(
@@ -193,7 +195,7 @@ export class HttpClient<SecurityDataType = unknown> {
193
195
  }
194
196
  };
195
197
 
196
- public request = async <T = any, E = any>({
198
+ public request = async <T = unknown, E = unknown>({
197
199
  body,
198
200
  secure,
199
201
  path,
@@ -1,6 +1,3 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- // @ts-nocheck
4
1
  /*
5
2
  * ---------------------------------------------------------------
6
3
  * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
@@ -47,7 +44,7 @@ export class 系统管理内容文章<SecurityDataType = unknown> {
47
44
  },
48
45
  params: RequestParams = {},
49
46
  ) =>
50
- this.http.request<PageResultContentArticle, any>({
47
+ this.http.request<PageResultContentArticle, unknown>({
51
48
  path: `/system/content-articles`,
52
49
  method: "GET",
53
50
  query: query,
@@ -69,7 +66,7 @@ export class 系统管理内容文章<SecurityDataType = unknown> {
69
66
  data: ContentArticleDraft,
70
67
  params: RequestParams = {},
71
68
  ) =>
72
- this.http.request<ContentArticle, any>({
69
+ this.http.request<ContentArticle, unknown>({
73
70
  path: `/system/content-articles`,
74
71
  method: "POST",
75
72
  body: data,
@@ -94,7 +91,7 @@ export class 系统管理内容文章<SecurityDataType = unknown> {
94
91
  },
95
92
  params: RequestParams = {},
96
93
  ) =>
97
- this.http.request<void, any>({
94
+ this.http.request<void, unknown>({
98
95
  path: `/system/content-articles`,
99
96
  method: "DELETE",
100
97
  body: data,
@@ -113,7 +110,7 @@ export class 系统管理内容文章<SecurityDataType = unknown> {
113
110
  * @response `200` `ContentArticle` 成功
114
111
  */
115
112
  contentArticlesDetail = (id: string, params: RequestParams = {}) =>
116
- this.http.request<ContentArticle, any>({
113
+ this.http.request<ContentArticle, unknown>({
117
114
  path: `/system/content-articles/${id}`,
118
115
  method: "GET",
119
116
  secure: true,
@@ -135,7 +132,7 @@ export class 系统管理内容文章<SecurityDataType = unknown> {
135
132
  data: ContentArticleDraft,
136
133
  params: RequestParams = {},
137
134
  ) =>
138
- this.http.request<ContentArticle, any>({
135
+ this.http.request<ContentArticle, unknown>({
139
136
  path: `/system/content-articles/${id}`,
140
137
  method: "PUT",
141
138
  body: data,
@@ -1,6 +1,3 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- // @ts-nocheck
4
1
  /*
5
2
  * ---------------------------------------------------------------
6
3
  * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
@@ -42,7 +39,7 @@ export class 系统管理审计<SecurityDataType = unknown> {
42
39
  },
43
40
  params: RequestParams = {},
44
41
  ) =>
45
- this.http.request<PageResultRbacAuditEvent, any>({
42
+ this.http.request<PageResultRbacAuditEvent, unknown>({
46
43
  path: `/system/audit`,
47
44
  method: "GET",
48
45
  query: query,
@@ -1,6 +1,3 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- // @ts-nocheck
4
1
  /*
5
2
  * ---------------------------------------------------------------
6
3
  * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
@@ -37,7 +34,7 @@ export class 系统管理文件上传<SecurityDataType = unknown> {
37
34
  },
38
35
  params: RequestParams = {},
39
36
  ) =>
40
- this.http.request<UploadResponse, any>({
37
+ this.http.request<UploadResponse, unknown>({
41
38
  path: `/system/uploads`,
42
39
  method: "POST",
43
40
  body: data,
@@ -57,7 +54,7 @@ export class 系统管理文件上传<SecurityDataType = unknown> {
57
54
  * @response `204` `void` 删除成功
58
55
  */
59
56
  uploadsDelete = (id: string, params: RequestParams = {}) =>
60
- this.http.request<void, any>({
57
+ this.http.request<void, unknown>({
61
58
  path: `/system/uploads/${id}`,
62
59
  method: "DELETE",
63
60
  secure: true,
@@ -1,6 +1,3 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- // @ts-nocheck
4
1
  /*
5
2
  * ---------------------------------------------------------------
6
3
  * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
@@ -50,7 +47,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
50
47
  },
51
48
  params: RequestParams = {},
52
49
  ) =>
53
- this.http.request<PageResultAdminUser, any>({
50
+ this.http.request<PageResultAdminUser, unknown>({
54
51
  path: `/system/users`,
55
52
  method: "GET",
56
53
  query: query,
@@ -69,7 +66,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
69
66
  * @response `200` `AdminUser` 创建成功
70
67
  */
71
68
  usersCreate = (data: AdminUserDraft, params: RequestParams = {}) =>
72
- this.http.request<AdminUser, any>({
69
+ this.http.request<AdminUser, unknown>({
73
70
  path: `/system/users`,
74
71
  method: "POST",
75
72
  body: data,
@@ -94,7 +91,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
94
91
  },
95
92
  params: RequestParams = {},
96
93
  ) =>
97
- this.http.request<void, any>({
94
+ this.http.request<void, unknown>({
98
95
  path: `/system/users`,
99
96
  method: "DELETE",
100
97
  body: data,
@@ -113,7 +110,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
113
110
  * @response `200` `AdminUser` 成功
114
111
  */
115
112
  usersDetail = (id: string, params: RequestParams = {}) =>
116
- this.http.request<AdminUser, any>({
113
+ this.http.request<AdminUser, unknown>({
117
114
  path: `/system/users/${id}`,
118
115
  method: "GET",
119
116
  secure: true,
@@ -135,7 +132,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
135
132
  data: AdminUserDraft,
136
133
  params: RequestParams = {},
137
134
  ) =>
138
- this.http.request<AdminUser, any>({
135
+ this.http.request<AdminUser, unknown>({
139
136
  path: `/system/users/${id}`,
140
137
  method: "PUT",
141
138
  body: data,
@@ -161,7 +158,7 @@ export class 系统管理用户<SecurityDataType = unknown> {
161
158
  },
162
159
  params: RequestParams = {},
163
160
  ) =>
164
- this.http.request<void, any>({
161
+ this.http.request<void, unknown>({
165
162
  path: `/system/users/status`,
166
163
  method: "PATCH",
167
164
  body: data,
@@ -1,6 +1,3 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- // @ts-nocheck
4
1
  /*
5
2
  * ---------------------------------------------------------------
6
3
  * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
@@ -36,7 +33,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
36
33
  * @response `200` `(BackendMenuNode)[]` 成功
37
34
  */
38
35
  menusTreeList = (params: RequestParams = {}) =>
39
- this.http.request<BackendMenuNode[], any>({
36
+ this.http.request<BackendMenuNode[], unknown>({
40
37
  path: `/system/menus/tree`,
41
38
  method: "GET",
42
39
  secure: true,
@@ -65,7 +62,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
65
62
  },
66
63
  params: RequestParams = {},
67
64
  ) =>
68
- this.http.request<PageResultRbacMenu, any>({
65
+ this.http.request<PageResultRbacMenu, unknown>({
69
66
  path: `/system/menus`,
70
67
  method: "GET",
71
68
  query: query,
@@ -84,7 +81,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
84
81
  * @response `200` `RbacMenu` 创建成功
85
82
  */
86
83
  menusCreate = (data: RbacMenuDraft, params: RequestParams = {}) =>
87
- this.http.request<RbacMenu, any>({
84
+ this.http.request<RbacMenu, unknown>({
88
85
  path: `/system/menus`,
89
86
  method: "POST",
90
87
  body: data,
@@ -109,7 +106,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
109
106
  },
110
107
  params: RequestParams = {},
111
108
  ) =>
112
- this.http.request<void, any>({
109
+ this.http.request<void, unknown>({
113
110
  path: `/system/menus`,
114
111
  method: "DELETE",
115
112
  body: data,
@@ -128,7 +125,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
128
125
  * @response `200` `RbacMenu` 成功
129
126
  */
130
127
  menusDetail = (id: string, params: RequestParams = {}) =>
131
- this.http.request<RbacMenu, any>({
128
+ this.http.request<RbacMenu, unknown>({
132
129
  path: `/system/menus/${id}`,
133
130
  method: "GET",
134
131
  secure: true,
@@ -146,7 +143,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
146
143
  * @response `200` `RbacMenu` 更新成功
147
144
  */
148
145
  menusUpdate = (id: string, data: RbacMenuDraft, params: RequestParams = {}) =>
149
- this.http.request<RbacMenu, any>({
146
+ this.http.request<RbacMenu, unknown>({
150
147
  path: `/system/menus/${id}`,
151
148
  method: "PUT",
152
149
  body: data,
@@ -172,7 +169,7 @@ export class 系统管理菜单<SecurityDataType = unknown> {
172
169
  },
173
170
  params: RequestParams = {},
174
171
  ) =>
175
- this.http.request<void, any>({
172
+ this.http.request<void, unknown>({
176
173
  path: `/system/menus/status`,
177
174
  method: "PATCH",
178
175
  body: data,
@@ -1,6 +1,3 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- // @ts-nocheck
4
1
  /*
5
2
  * ---------------------------------------------------------------
6
3
  * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
@@ -48,7 +45,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
48
45
  },
49
46
  params: RequestParams = {},
50
47
  ) =>
51
- this.http.request<PageResultAdminRole, any>({
48
+ this.http.request<PageResultAdminRole, unknown>({
52
49
  path: `/system/roles`,
53
50
  method: "GET",
54
51
  query: query,
@@ -67,7 +64,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
67
64
  * @response `200` `AdminRole` 创建成功
68
65
  */
69
66
  rolesCreate = (data: AdminRoleDraft, params: RequestParams = {}) =>
70
- this.http.request<AdminRole, any>({
67
+ this.http.request<AdminRole, unknown>({
71
68
  path: `/system/roles`,
72
69
  method: "POST",
73
70
  body: data,
@@ -92,7 +89,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
92
89
  },
93
90
  params: RequestParams = {},
94
91
  ) =>
95
- this.http.request<void, any>({
92
+ this.http.request<void, unknown>({
96
93
  path: `/system/roles`,
97
94
  method: "DELETE",
98
95
  body: data,
@@ -111,7 +108,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
111
108
  * @response `200` `AdminRole` 成功
112
109
  */
113
110
  rolesDetail = (id: string, params: RequestParams = {}) =>
114
- this.http.request<AdminRole, any>({
111
+ this.http.request<AdminRole, unknown>({
115
112
  path: `/system/roles/${id}`,
116
113
  method: "GET",
117
114
  secure: true,
@@ -133,7 +130,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
133
130
  data: AdminRoleDraft,
134
131
  params: RequestParams = {},
135
132
  ) =>
136
- this.http.request<AdminRole, any>({
133
+ this.http.request<AdminRole, unknown>({
137
134
  path: `/system/roles/${id}`,
138
135
  method: "PUT",
139
136
  body: data,
@@ -159,7 +156,7 @@ export class 系统管理角色<SecurityDataType = unknown> {
159
156
  },
160
157
  params: RequestParams = {},
161
158
  ) =>
162
- this.http.request<void, any>({
159
+ this.http.request<void, unknown>({
163
160
  path: `/system/roles/status`,
164
161
  method: "PATCH",
165
162
  body: data,
@@ -1,6 +1,3 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- // @ts-nocheck
4
1
  /*
5
2
  * ---------------------------------------------------------------
6
3
  * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
@@ -48,7 +45,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
48
45
  },
49
46
  params: RequestParams = {},
50
47
  ) =>
51
- this.http.request<PageResultOrderDraft, any>({
48
+ this.http.request<PageResultOrderDraft, unknown>({
52
49
  path: `/system/order-drafts`,
53
50
  method: "GET",
54
51
  query: query,
@@ -67,7 +64,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
67
64
  * @response `200` `OrderDraft` 创建成功
68
65
  */
69
66
  orderDraftsCreate = (data: OrderDraftDraft, params: RequestParams = {}) =>
70
- this.http.request<OrderDraft, any>({
67
+ this.http.request<OrderDraft, unknown>({
71
68
  path: `/system/order-drafts`,
72
69
  method: "POST",
73
70
  body: data,
@@ -92,7 +89,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
92
89
  },
93
90
  params: RequestParams = {},
94
91
  ) =>
95
- this.http.request<void, any>({
92
+ this.http.request<void, unknown>({
96
93
  path: `/system/order-drafts`,
97
94
  method: "DELETE",
98
95
  body: data,
@@ -111,7 +108,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
111
108
  * @response `200` `OrderDraft` 成功
112
109
  */
113
110
  orderDraftsDetail = (id: string, params: RequestParams = {}) =>
114
- this.http.request<OrderDraft, any>({
111
+ this.http.request<OrderDraft, unknown>({
115
112
  path: `/system/order-drafts/${id}`,
116
113
  method: "GET",
117
114
  secure: true,
@@ -133,7 +130,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
133
130
  data: OrderDraftDraft,
134
131
  params: RequestParams = {},
135
132
  ) =>
136
- this.http.request<OrderDraft, any>({
133
+ this.http.request<OrderDraft, unknown>({
137
134
  path: `/system/order-drafts/${id}`,
138
135
  method: "PUT",
139
136
  body: data,
@@ -159,7 +156,7 @@ export class 系统管理订单草稿<SecurityDataType = unknown> {
159
156
  },
160
157
  params: RequestParams = {},
161
158
  ) =>
162
- this.http.request<OrderDraft, any>({
159
+ this.http.request<OrderDraft, unknown>({
163
160
  path: `/system/order-drafts/${id}/status`,
164
161
  method: "PATCH",
165
162
  body: data,
@@ -1,6 +1,3 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- // @ts-nocheck
4
1
  /*
5
2
  * ---------------------------------------------------------------
6
3
  * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
@@ -35,7 +32,7 @@ export class 认证<SecurityDataType = unknown> {
35
32
  * @response `200` `LoginResponse` 登录成功
36
33
  */
37
34
  loginCreate = (data: LoginCredentials, params: RequestParams = {}) =>
38
- this.http.request<LoginResponse, any>({
35
+ this.http.request<LoginResponse, unknown>({
39
36
  path: `/auth/login`,
40
37
  method: "POST",
41
38
  body: data,
@@ -55,7 +52,7 @@ export class 认证<SecurityDataType = unknown> {
55
52
  * @response `200` `ProfileResponse` 成功
56
53
  */
57
54
  profileList = (params: RequestParams = {}) =>
58
- this.http.request<ProfileResponse, any>({
55
+ this.http.request<ProfileResponse, unknown>({
59
56
  path: `/auth/profile`,
60
57
  method: "GET",
61
58
  secure: true,
@@ -85,7 +82,7 @@ export class 认证<SecurityDataType = unknown> {
85
82
  {
86
83
  token?: string;
87
84
  },
88
- any
85
+ unknown
89
86
  >({
90
87
  path: `/auth/refresh`,
91
88
  method: "POST",
@@ -0,0 +1,90 @@
1
+ import { appRuntimeConfig } from './runtimeConfig'
2
+
3
+ export type AdminLocale = 'zh-CN' | 'en-US' | 'zh-TW'
4
+
5
+ export const SUPPORTED_LOCALES: readonly AdminLocale[] = ['zh-CN', 'en-US', 'zh-TW']
6
+ export const LOCALE_STORAGE_KEY = 'og-admin-locale'
7
+
8
+ /** Synchronous in-memory state — the single truth source for HTTP Accept-Language. */
9
+ let currentLocale: AdminLocale = 'zh-CN'
10
+
11
+ /**
12
+ * Normalizes a raw locale string to one of the three supported locales.
13
+ * - `en-*` → `en-US`
14
+ * - `zh-Hant`, `zh-TW`, `zh-HK`, `zh-MO` → `zh-TW`
15
+ * - All other `zh-*` → `zh-CN`
16
+ * Returns `undefined` for unsupported or empty values.
17
+ */
18
+ export function normalizeAdminLocale(value: unknown): AdminLocale | undefined {
19
+ if (typeof value !== 'string') return undefined
20
+ const trimmed = value.trim()
21
+ if (!trimmed) return undefined
22
+ const lower = trimmed.toLowerCase()
23
+
24
+ // en-* variants → en-US
25
+ if (lower === 'en' || lower.startsWith('en-')) return 'en-US'
26
+
27
+ // zh-Hant / traditional script regions → zh-TW
28
+ if (
29
+ lower === 'zh-hant' ||
30
+ lower === 'zh-tw' ||
31
+ lower === 'zh-hk' ||
32
+ lower === 'zh-mo'
33
+ ) {
34
+ return 'zh-TW'
35
+ }
36
+
37
+ // All other zh-* variants → zh-CN
38
+ if (lower === 'zh' || lower === 'zh-hans' || lower.startsWith('zh-')) return 'zh-CN'
39
+
40
+ return undefined
41
+ }
42
+
43
+ function readPersistedLocale(): AdminLocale | undefined {
44
+ if (typeof localStorage === 'undefined') return undefined
45
+ try {
46
+ return normalizeAdminLocale(localStorage.getItem(LOCALE_STORAGE_KEY))
47
+ } catch {
48
+ return undefined
49
+ }
50
+ }
51
+
52
+ function navigateLanguages(): AdminLocale | undefined {
53
+ if (typeof navigator === 'undefined') return undefined
54
+ if (navigator.languages && navigator.languages.length > 0) {
55
+ for (const lang of navigator.languages) {
56
+ const result = normalizeAdminLocale(lang)
57
+ if (result) return result
58
+ }
59
+ }
60
+ return normalizeAdminLocale(navigator.language)
61
+ }
62
+
63
+ /**
64
+ * Chooses the initial locale from (in priority order):
65
+ * 1. Persisted value (localStorage)
66
+ * 2. Environment config (`VITE_DEFAULT_LOCALE`)
67
+ * 3. `navigator.languages`
68
+ * 4. `navigator.language`
69
+ * 5. Runtime config default
70
+ * 6. Hard-coded `zh-CN`
71
+ */
72
+ export function resolveInitialLocale(): AdminLocale {
73
+ return (
74
+ readPersistedLocale() ??
75
+ normalizeAdminLocale(import.meta.env.VITE_DEFAULT_LOCALE) ??
76
+ navigateLanguages() ??
77
+ normalizeAdminLocale(appRuntimeConfig.locale.default) ??
78
+ 'zh-CN'
79
+ )
80
+ }
81
+
82
+ /** Returns the current synchronous locale — the HTTP Accept-Language source. */
83
+ export function currentAdminLocale(): AdminLocale {
84
+ return currentLocale
85
+ }
86
+
87
+ /** Updates the synchronous locale state. */
88
+ export function setAdminLocale(locale: AdminLocale): void {
89
+ currentLocale = locale
90
+ }