create-react-admin-template 0.0.0-stage → 0.1.0
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/README.md +46 -2
- package/bin/create.mjs +5 -0
- package/package.json +22 -4
- package/template/.dockerignore +12 -0
- package/template/.editorconfig +12 -0
- package/template/.env +14 -0
- package/template/.env.development +5 -0
- package/template/.env.production +2 -0
- package/template/.env.test +5 -0
- package/template/.github/workflows/ci.yml +40 -0
- package/template/.gitlab-ci.yml +208 -0
- package/template/.husky/commit-msg +1 -0
- package/template/.husky/pre-commit +1 -0
- package/template/.nvmrc +1 -0
- package/template/.prettierignore +11 -0
- package/template/.prettierrc +47 -0
- package/template/Dockerfile +16 -0
- package/template/README.md +372 -0
- package/template/build/advancedTable.ts +103 -0
- package/template/build/environment.ts +150 -0
- package/template/commitlint.config.js +32 -0
- package/template/components.json +21 -0
- package/template/deploy/README.md +132 -0
- package/template/deploy/host-nginx/react-admin-api.conf +14 -0
- package/template/deploy/host-nginx/react-admin-web.conf +8 -0
- package/template/deploy/nginx.conf +38 -0
- package/template/docs/activity-status.md +217 -0
- package/template/docs/audit-logs.md +158 -0
- package/template/docs/authentication-adapters.md +219 -0
- package/template/docs/browser-security.md +58 -0
- package/template/docs/bundle-budgets.md +65 -0
- package/template/docs/component-source-governance.md +99 -0
- package/template/docs/data-masking.md +169 -0
- package/template/docs/enterprise-scaffold.md +208 -0
- package/template/docs/feature-data-template.md +227 -0
- package/template/docs/feature-flags.md +169 -0
- package/template/docs/file-capabilities.md +196 -0
- package/template/docs/locale-and-i18n.md +132 -0
- package/template/docs/mutation-idempotency.md +24 -0
- package/template/docs/optional-editors.md +203 -0
- package/template/docs/page-feedback.md +83 -0
- package/template/docs/query-data-conventions.md +178 -0
- package/template/docs/realtime-collaboration.md +140 -0
- package/template/docs/reporting-printing-templates.md +156 -0
- package/template/docs/scaffold-capability-roadmap.md +226 -0
- package/template/docs/scaffold-guide.md +443 -0
- package/template/docs/template-changelog.md +30 -0
- package/template/docs/template-versioning.md +26 -0
- package/template/docs/tenant-workspace-context.md +147 -0
- package/template/docs/unsaved-changes.md +58 -0
- package/template/docs/white-label.md +102 -0
- package/template/eslint.config.js +697 -0
- package/template/gitignore +39 -0
- package/template/index.html +26 -0
- package/template/knip.config.ts +42 -0
- package/template/lint-staged.config.js +8 -0
- package/template/package.json +133 -0
- package/template/pnpm-lock.yaml +8694 -0
- package/template/public/favicon.ico +0 -0
- package/template/public/logo.svg +1 -0
- package/template/public/runtime-config.json +49 -0
- package/template/scaffold.template.json +5 -0
- package/template/src/Application.tsx +114 -0
- package/template/src/api/ApiError.ts +33 -0
- package/template/src/api/activity/ActivityProvider.tsx +167 -0
- package/template/src/api/activity/access.ts +13 -0
- package/template/src/api/activity/errors.ts +17 -0
- package/template/src/api/activity/index.ts +67 -0
- package/template/src/api/activity/model.ts +227 -0
- package/template/src/api/activity/query.ts +163 -0
- package/template/src/api/activity/source.ts +16 -0
- package/template/src/api/activity/subscription.ts +292 -0
- package/template/src/api/activity/transports.ts +271 -0
- package/template/src/api/activity/types.ts +402 -0
- package/template/src/api/authClient.ts +134 -0
- package/template/src/api/authSession.ts +307 -0
- package/template/src/api/clients/configureApiClient.ts +62 -0
- package/template/src/api/clients/httpStatus.ts +4 -0
- package/template/src/api/config/services.json +7 -0
- package/template/src/api/demoAuthClient.ts +46 -0
- package/template/src/api/enums/EnumCatalogProvider.tsx +169 -0
- package/template/src/api/enums/EnumDictionary.ts +55 -0
- package/template/src/api/enums/access.ts +130 -0
- package/template/src/api/enums/catalog.ts +216 -0
- package/template/src/api/enums/errors.ts +21 -0
- package/template/src/api/enums/index.ts +48 -0
- package/template/src/api/enums/query.ts +82 -0
- package/template/src/api/enums/scope.ts +58 -0
- package/template/src/api/enums/types.ts +251 -0
- package/template/src/api/hooks/error.ts +198 -0
- package/template/src/api/hooks/index.ts +4 -0
- package/template/src/api/hooks/request.ts +99 -0
- package/template/src/api/hooks/requestId.ts +65 -0
- package/template/src/api/hooks/response.ts +22 -0
- package/template/src/api/hooks/types.ts +20 -0
- package/template/src/api/idempotency/index.ts +1 -0
- package/template/src/api/idempotency/key.ts +23 -0
- package/template/src/api/index.ts +14 -0
- package/template/src/api/metadata/MetadataProvider.tsx +37 -0
- package/template/src/api/metadata/index.ts +2 -0
- package/template/src/api/metadata/types.ts +30 -0
- package/template/src/api/parameters/GlobalParameterProvider.tsx +210 -0
- package/template/src/api/parameters/access.ts +117 -0
- package/template/src/api/parameters/catalog.ts +170 -0
- package/template/src/api/parameters/errors.ts +21 -0
- package/template/src/api/parameters/index.ts +53 -0
- package/template/src/api/parameters/query.ts +84 -0
- package/template/src/api/parameters/scope.ts +58 -0
- package/template/src/api/parameters/types.ts +214 -0
- package/template/src/api/query/index.ts +13 -0
- package/template/src/api/query/keys.ts +155 -0
- package/template/src/api/query/mutation.ts +48 -0
- package/template/src/api/query/react.ts +36 -0
- package/template/src/api/query/scope.ts +38 -0
- package/template/src/api/query/types.ts +147 -0
- package/template/src/api/types.ts +144 -0
- package/template/src/application/types.ts +52 -0
- package/template/src/auditLogs/errors.ts +17 -0
- package/template/src/auditLogs/export.ts +85 -0
- package/template/src/auditLogs/index.ts +54 -0
- package/template/src/auditLogs/model.ts +526 -0
- package/template/src/auditLogs/query.ts +113 -0
- package/template/src/auditLogs/react.ts +36 -0
- package/template/src/auditLogs/source.ts +51 -0
- package/template/src/auditLogs/types.ts +357 -0
- package/template/src/authentication/controller.ts +351 -0
- package/template/src/authentication/index.ts +8 -0
- package/template/src/authentication/redirect.ts +72 -0
- package/template/src/authentication/types.ts +300 -0
- package/template/src/bootstrap.tsx +96 -0
- package/template/src/components/AppDataTable/AppDataTable.tsx +74 -0
- package/template/src/components/AppDataTable/index.ts +2 -0
- package/template/src/components/AppDataTable/types.ts +27 -0
- package/template/src/components/AppDialog/AppConfirmDialog.tsx +44 -0
- package/template/src/components/AppDialog/AppDialog.tsx +113 -0
- package/template/src/components/AppDialog/index.ts +3 -0
- package/template/src/components/AppDialog/messages.tsx +22 -0
- package/template/src/components/AppDialog/types.ts +53 -0
- package/template/src/components/AppPageForm/AppPageForm.tsx +21 -0
- package/template/src/components/AppPageForm/PageForm.tsx +765 -0
- package/template/src/components/AppPageForm/SOURCE.md +26 -0
- package/template/src/components/AppPageForm/config.ts +253 -0
- package/template/src/components/AppPageForm/controller.ts +580 -0
- package/template/src/components/AppPageForm/index.ts +2 -0
- package/template/src/components/AppPageForm/messages.ts +90 -0
- package/template/src/components/AppPageForm/optionUtils.ts +91 -0
- package/template/src/components/AppPageForm/options.ts +397 -0
- package/template/src/components/AppPageForm/query.ts +44 -0
- package/template/src/components/AppPageForm/style.css +119 -0
- package/template/src/components/AppPageForm/types.ts +632 -0
- package/template/src/components/AppPageForm/validation.ts +233 -0
- package/template/src/components/AppTable/AppTable.tsx +26 -0
- package/template/src/components/AppTable/SOURCE.md +72 -0
- package/template/src/components/AppTable/cell/customCell/TableCellLayer.tsx +73 -0
- package/template/src/components/AppTable/cell/customCell/actions/ActionDropdownCell.tsx +104 -0
- package/template/src/components/AppTable/cell/customCell/cellLayer.ts +358 -0
- package/template/src/components/AppTable/cell/customCell/componentProps.ts +30 -0
- package/template/src/components/AppTable/cell/customCell/date/TemporalPickerEditor.tsx +54 -0
- package/template/src/components/AppTable/cell/customCell/index.ts +2 -0
- package/template/src/components/AppTable/cell/customCell/select/SelectCellEditor.tsx +225 -0
- package/template/src/components/AppTable/cell/customCell/tableCellLayer.css +20 -0
- package/template/src/components/AppTable/cell/customCell/tooltip/TooltipCell.tsx +45 -0
- package/template/src/components/AppTable/cell/customCell/types.ts +63 -0
- package/template/src/components/AppTable/cell/customCell/useCellLayerLifecycle.ts +111 -0
- package/template/src/components/AppTable/cell/frameworkCell/TableCellComponentLayer.tsx +40 -0
- package/template/src/components/AppTable/cell/frameworkCell/cellComponentSession.ts +203 -0
- package/template/src/components/AppTable/cell/frameworkCell/index.ts +3 -0
- package/template/src/components/AppTable/cell/index.ts +2 -0
- package/template/src/components/AppTable/columns/TableColumnEditor.tsx +257 -0
- package/template/src/components/AppTable/columns/index.ts +1 -0
- package/template/src/components/AppTable/columns/useTableColumnPreferenceActions.ts +85 -0
- package/template/src/components/AppTable/config/defaults.ts +46 -0
- package/template/src/components/AppTable/config/index.ts +2 -0
- package/template/src/components/AppTable/config/license.ts +39 -0
- package/template/src/components/AppTable/config/resolver.ts +25 -0
- package/template/src/components/AppTable/config/types.ts +377 -0
- package/template/src/components/AppTable/engine/bottom/index.ts +1 -0
- package/template/src/components/AppTable/engine/bottom/types.ts +14 -0
- package/template/src/components/AppTable/engine/cell/constants.ts +32 -0
- package/template/src/components/AppTable/engine/cell/customCell/actions/index.ts +1 -0
- package/template/src/components/AppTable/engine/cell/customCell/actions/renderer.ts +162 -0
- package/template/src/components/AppTable/engine/cell/customCell/date/index.ts +1 -0
- package/template/src/components/AppTable/engine/cell/customCell/date/renderer.ts +116 -0
- package/template/src/components/AppTable/engine/cell/customCell/editors/editorBounds.ts +57 -0
- package/template/src/components/AppTable/engine/cell/customCell/editors/editorTrigger.ts +46 -0
- package/template/src/components/AppTable/engine/cell/customCell/editors/index.ts +3 -0
- package/template/src/components/AppTable/engine/cell/customCell/editors/layerEditor.ts +244 -0
- package/template/src/components/AppTable/engine/cell/customCell/index.ts +7 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/columnRenderer.ts +245 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/confirmInput.ts +57 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/display.ts +78 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/index.ts +3 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/itemList.ts +60 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/links.ts +131 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/selection.ts +41 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/shared.ts +71 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/step.ts +37 -0
- package/template/src/components/AppTable/engine/cell/customCell/renderers/switch.ts +45 -0
- package/template/src/components/AppTable/engine/cell/customCell/select/index.ts +1 -0
- package/template/src/components/AppTable/engine/cell/customCell/select/renderer.ts +33 -0
- package/template/src/components/AppTable/engine/cell/customCell/tooltip/index.ts +1 -0
- package/template/src/components/AppTable/engine/cell/customCell/tooltip/tooltip.ts +94 -0
- package/template/src/components/AppTable/engine/cell/customCell/types.ts +82 -0
- package/template/src/components/AppTable/engine/cell/formatting.ts +355 -0
- package/template/src/components/AppTable/engine/cell/formula.ts +145 -0
- package/template/src/components/AppTable/engine/cell/index.ts +7 -0
- package/template/src/components/AppTable/engine/cell/multiSelect.ts +96 -0
- package/template/src/components/AppTable/engine/cell/options.ts +339 -0
- package/template/src/components/AppTable/engine/cell/types.ts +53 -0
- package/template/src/components/AppTable/engine/columns/column.ts +430 -0
- package/template/src/components/AppTable/engine/columns/config/columns.ts +33 -0
- package/template/src/components/AppTable/engine/columns/config/index.ts +4 -0
- package/template/src/components/AppTable/engine/columns/config/mutation.ts +138 -0
- package/template/src/components/AppTable/engine/columns/config/temporal.ts +11 -0
- package/template/src/components/AppTable/engine/columns/config/validation.ts +106 -0
- package/template/src/components/AppTable/engine/columns/constants.ts +6 -0
- package/template/src/components/AppTable/engine/columns/gridColumns.ts +332 -0
- package/template/src/components/AppTable/engine/columns/index.ts +4 -0
- package/template/src/components/AppTable/engine/columns/rendererPolicies.ts +129 -0
- package/template/src/components/AppTable/engine/component/resolver.ts +272 -0
- package/template/src/components/AppTable/engine/component/types.ts +384 -0
- package/template/src/components/AppTable/engine/config/constants.ts +33 -0
- package/template/src/components/AppTable/engine/config/grid/compiler.ts +65 -0
- package/template/src/components/AppTable/engine/config/grid/defaults.ts +82 -0
- package/template/src/components/AppTable/engine/config/grid/ownership.ts +35 -0
- package/template/src/components/AppTable/engine/config/grid/runtimeDelta.ts +34 -0
- package/template/src/components/AppTable/engine/config/grid/types.ts +30 -0
- package/template/src/components/AppTable/engine/pagination/config.ts +75 -0
- package/template/src/components/AppTable/engine/pagination/constants.ts +5 -0
- package/template/src/components/AppTable/engine/pagination/index.ts +3 -0
- package/template/src/components/AppTable/engine/pagination/types.ts +70 -0
- package/template/src/components/AppTable/engine/preference/index.ts +2 -0
- package/template/src/components/AppTable/engine/preference/preference.ts +535 -0
- package/template/src/components/AppTable/engine/preference/types.ts +28 -0
- package/template/src/components/AppTable/engine/right/index.ts +1 -0
- package/template/src/components/AppTable/engine/right/types.ts +18 -0
- package/template/src/components/AppTable/engine/search/config.ts +64 -0
- package/template/src/components/AppTable/engine/search/constants.ts +8 -0
- package/template/src/components/AppTable/engine/search/index.ts +7 -0
- package/template/src/components/AppTable/engine/search/localQuery.ts +145 -0
- package/template/src/components/AppTable/engine/search/query.ts +203 -0
- package/template/src/components/AppTable/engine/search/remoteQuery.ts +99 -0
- package/template/src/components/AppTable/engine/search/searchInteraction.ts +46 -0
- package/template/src/components/AppTable/engine/search/types.ts +155 -0
- package/template/src/components/AppTable/engine/selection/config.ts +13 -0
- package/template/src/components/AppTable/engine/selection/index.ts +4 -0
- package/template/src/components/AppTable/engine/selection/selection.ts +357 -0
- package/template/src/components/AppTable/engine/selection/selectionHeader.ts +88 -0
- package/template/src/components/AppTable/engine/selection/types.ts +66 -0
- package/template/src/components/AppTable/engine/shared/action.ts +11 -0
- package/template/src/components/AppTable/engine/shared/constants.ts +2 -0
- package/template/src/components/AppTable/engine/shared/decimal.ts +114 -0
- package/template/src/components/AppTable/engine/shared/feedback.ts +62 -0
- package/template/src/components/AppTable/engine/shared/index.ts +13 -0
- package/template/src/components/AppTable/engine/shared/interaction.ts +55 -0
- package/template/src/components/AppTable/engine/shared/messages.ts +161 -0
- package/template/src/components/AppTable/engine/shared/row.ts +32 -0
- package/template/src/components/AppTable/engine/shared/scheduler.ts +17 -0
- package/template/src/components/AppTable/engine/shared/tableKey.ts +31 -0
- package/template/src/components/AppTable/engine/shared/theme.ts +196 -0
- package/template/src/components/AppTable/engine/shared/treeRows.ts +155 -0
- package/template/src/components/AppTable/engine/shared/types.ts +58 -0
- package/template/src/components/AppTable/engine/shared/valueSnapshot.ts +46 -0
- package/template/src/components/AppTable/engine/summary/config/export.ts +117 -0
- package/template/src/components/AppTable/engine/summary/config/index.ts +3 -0
- package/template/src/components/AppTable/engine/summary/config/summary.ts +62 -0
- package/template/src/components/AppTable/engine/summary/config/types.ts +93 -0
- package/template/src/components/AppTable/engine/summary/constants.ts +13 -0
- package/template/src/components/AppTable/engine/summary/excelJs.ts +133 -0
- package/template/src/components/AppTable/engine/summary/export.ts +311 -0
- package/template/src/components/AppTable/engine/summary/index.ts +6 -0
- package/template/src/components/AppTable/engine/summary/selectionSum.ts +92 -0
- package/template/src/components/AppTable/engine/summary/summary.ts +457 -0
- package/template/src/components/AppTable/engine/table/clipboard/index.ts +1 -0
- package/template/src/components/AppTable/engine/table/clipboard/transfer.ts +9 -0
- package/template/src/components/AppTable/engine/table/controller/TableController.ts +802 -0
- package/template/src/components/AppTable/engine/table/controller/errors.ts +106 -0
- package/template/src/components/AppTable/engine/table/controller/index.ts +4 -0
- package/template/src/components/AppTable/engine/table/controller/latestAbortableTask.ts +33 -0
- package/template/src/components/AppTable/engine/table/controller/tableDataReplacement.ts +60 -0
- package/template/src/components/AppTable/engine/table/controller/tableDomainConfiguration.ts +94 -0
- package/template/src/components/AppTable/engine/table/controller/tableEditingCommands.ts +163 -0
- package/template/src/components/AppTable/engine/table/controller/tableGridHost.ts +324 -0
- package/template/src/components/AppTable/engine/table/controller/tableIdentity.ts +68 -0
- package/template/src/components/AppTable/engine/table/controller/tableMutationPipeline.ts +79 -0
- package/template/src/components/AppTable/engine/table/controller/tableQueryCoordinator.ts +187 -0
- package/template/src/components/AppTable/engine/table/controller/tableReportingCoordinator.ts +143 -0
- package/template/src/components/AppTable/engine/table/controller/tableSaveCoordinator.ts +227 -0
- package/template/src/components/AppTable/engine/table/controller/tableSaveValidation.ts +29 -0
- package/template/src/components/AppTable/engine/table/controller/tableSnapshot.ts +58 -0
- package/template/src/components/AppTable/engine/table/controller/types.ts +202 -0
- package/template/src/components/AppTable/engine/table/editing/baselineStore.ts +134 -0
- package/template/src/components/AppTable/engine/table/editing/changeSet.ts +492 -0
- package/template/src/components/AppTable/engine/table/editing/changeSetSettlement.ts +633 -0
- package/template/src/components/AppTable/engine/table/editing/commitResultIndex.ts +75 -0
- package/template/src/components/AppTable/engine/table/editing/constants.ts +15 -0
- package/template/src/components/AppTable/engine/table/editing/dirtyCellIndex.ts +96 -0
- package/template/src/components/AppTable/engine/table/editing/index.ts +6 -0
- package/template/src/components/AppTable/engine/table/editing/mutation.ts +173 -0
- package/template/src/components/AppTable/engine/table/editing/rowKey.ts +10 -0
- package/template/src/components/AppTable/engine/table/editing/types.ts +404 -0
- package/template/src/components/AppTable/engine/table/editing/validation.ts +452 -0
- package/template/src/components/AppTable/engine/table/grid/cellMeta.ts +90 -0
- package/template/src/components/AppTable/engine/table/grid/handsontable.ts +25 -0
- package/template/src/components/AppTable/engine/table/grid/handsontableExtensions.d.ts +26 -0
- package/template/src/components/AppTable/engine/table/grid/index.ts +5 -0
- package/template/src/components/AppTable/engine/table/grid/moduleRegistry.ts +39 -0
- package/template/src/components/AppTable/engine/table/grid/runtime.ts +31 -0
- package/template/src/components/AppTable/engine/table/grid/types.ts +25 -0
- package/template/src/components/AppTable/engine/table/hooks/fixedEndHooks.ts +44 -0
- package/template/src/components/AppTable/engine/table/hooks/gridHooks.ts +108 -0
- package/template/src/components/AppTable/engine/table/hooks/headerHooks.ts +103 -0
- package/template/src/components/AppTable/engine/table/hooks/index.ts +3 -0
- package/template/src/components/AppTable/engine/table/index.ts +6 -0
- package/template/src/components/AppTable/engine/table/layout/constants.ts +2 -0
- package/template/src/components/AppTable/engine/table/layout/dropdownMenu.ts +89 -0
- package/template/src/components/AppTable/engine/table/layout/fixedColumns.ts +44 -0
- package/template/src/components/AppTable/engine/table/layout/fixedEndOverlay.ts +90 -0
- package/template/src/components/AppTable/engine/table/layout/fixedEndOverlayAccessibility.ts +104 -0
- package/template/src/components/AppTable/engine/table/layout/fixedEndOverlayRenderer.ts +690 -0
- package/template/src/components/AppTable/engine/table/layout/fixedEndOverlaySignature.ts +58 -0
- package/template/src/components/AppTable/engine/table/layout/fixedEndRuntime.ts +137 -0
- package/template/src/components/AppTable/engine/table/layout/handsontableDomAdapter.ts +40 -0
- package/template/src/components/AppTable/engine/table/layout/height.ts +72 -0
- package/template/src/components/AppTable/engine/table/layout/index.ts +14 -0
- package/template/src/components/AppTable/engine/table/layout/layoutScheduler.ts +60 -0
- package/template/src/components/AppTable/engine/table/layout/mergeCells.ts +146 -0
- package/template/src/components/AppTable/engine/table/layout/nestedHeaders.ts +271 -0
- package/template/src/components/AppTable/engine/table/layout/types.ts +10 -0
- package/template/src/components/AppTable/engine/toolbar/index.ts +1 -0
- package/template/src/components/AppTable/engine/toolbar/types.ts +56 -0
- package/template/src/components/AppTable/index.ts +11 -0
- package/template/src/components/AppTable/messages.ts +256 -0
- package/template/src/components/AppTable/pagination/TablePaginationBar.tsx +193 -0
- package/template/src/components/AppTable/pagination/index.ts +1 -0
- package/template/src/components/AppTable/pagination/paginationItems.ts +56 -0
- package/template/src/components/AppTable/preference/index.ts +1 -0
- package/template/src/components/AppTable/preference/useTablePreference.ts +208 -0
- package/template/src/components/AppTable/reporting/index.ts +1 -0
- package/template/src/components/AppTable/reporting/useTableReporting.ts +342 -0
- package/template/src/components/AppTable/search/TableSearchBar.tsx +301 -0
- package/template/src/components/AppTable/search/TableSearchConditionEditor.tsx +254 -0
- package/template/src/components/AppTable/search/TableSearchField.tsx +338 -0
- package/template/src/components/AppTable/search/TableSearchFields.tsx +65 -0
- package/template/src/components/AppTable/search/constants.ts +9 -0
- package/template/src/components/AppTable/search/index.ts +3 -0
- package/template/src/components/AppTable/search/tableSearchBar.css +164 -0
- package/template/src/components/AppTable/search/types.ts +7 -0
- package/template/src/components/AppTable/search/useTableQuery.ts +373 -0
- package/template/src/components/AppTable/selection/index.ts +1 -0
- package/template/src/components/AppTable/selection/useTableSelection.ts +188 -0
- package/template/src/components/AppTable/sensitiveData.tsx +41 -0
- package/template/src/components/AppTable/shared/styles.ts +2 -0
- package/template/src/components/AppTable/styles/index.css +6 -0
- package/template/src/components/AppTable/styles/tableComponent.css +297 -0
- package/template/src/components/AppTable/styles/theme.css +133 -0
- package/template/src/components/AppTable/table/components/TableComponent.tsx +567 -0
- package/template/src/components/AppTable/table/components/TableErrorFeedback.tsx +36 -0
- package/template/src/components/AppTable/table/components/TableGridViewport.tsx +85 -0
- package/template/src/components/AppTable/table/components/index.ts +2 -0
- package/template/src/components/AppTable/table/components/types.ts +90 -0
- package/template/src/components/AppTable/table/controller/configuration.ts +89 -0
- package/template/src/components/AppTable/table/controller/index.ts +2 -0
- package/template/src/components/AppTable/table/controller/useTableController.ts +155 -0
- package/template/src/components/AppTable/table/controller/useTableLifecycle.ts +97 -0
- package/template/src/components/AppTable/table/grid/index.ts +1 -0
- package/template/src/components/AppTable/table/grid/useTableGrid.ts +857 -0
- package/template/src/components/AppTable/table/grid/useTableGridRuntimeSettings.ts +49 -0
- package/template/src/components/AppTable/table/index.ts +4 -0
- package/template/src/components/AppTable/table/layout/TablePanels.tsx +389 -0
- package/template/src/components/AppTable/table/layout/index.ts +7 -0
- package/template/src/components/AppTable/table/layout/types.ts +3 -0
- package/template/src/components/AppTable/table/layout/useResizablePanel.ts +213 -0
- package/template/src/components/AppTable/table/layout/useTableAdaptiveHeight.ts +238 -0
- package/template/src/components/AppTable/table/layout/useTablePanels.ts +329 -0
- package/template/src/components/AppTable/table/layout/useTableTheme.ts +123 -0
- package/template/src/components/AppTable/toolbar/TableToolbar.tsx +336 -0
- package/template/src/components/AppTable/toolbar/index.ts +1 -0
- package/template/src/components/BrandLogo/BrandLogo.tsx +41 -0
- package/template/src/components/BrandLogo/index.ts +1 -0
- package/template/src/components/Can/Can.tsx +19 -0
- package/template/src/components/Can/index.ts +7 -0
- package/template/src/components/Can/types.ts +41 -0
- package/template/src/components/EnumBadge/EnumBadge.tsx +44 -0
- package/template/src/components/EnumBadge/index.ts +2 -0
- package/template/src/components/EnumBadge/types.ts +16 -0
- package/template/src/components/EnumText/EnumText.tsx +33 -0
- package/template/src/components/EnumText/index.ts +2 -0
- package/template/src/components/EnumText/types.ts +13 -0
- package/template/src/components/FilePreview/FilePreview.tsx +120 -0
- package/template/src/components/FilePreview/index.ts +11 -0
- package/template/src/components/FilePreview/preview.ts +88 -0
- package/template/src/components/FilePreview/types.ts +91 -0
- package/template/src/components/FileUpload/FileUpload.tsx +172 -0
- package/template/src/components/FileUpload/index.ts +2 -0
- package/template/src/components/FileUpload/types.ts +32 -0
- package/template/src/components/JsonEditor/JsonEditor.tsx +103 -0
- package/template/src/components/JsonEditor/index.ts +1 -0
- package/template/src/components/JsonEditor/types.ts +14 -0
- package/template/src/components/PageFeedback/PageFeedback.tsx +194 -0
- package/template/src/components/PageFeedback/index.ts +10 -0
- package/template/src/components/PageFeedback/types.ts +31 -0
- package/template/src/components/PasswordInput/PasswordInput.tsx +50 -0
- package/template/src/components/PasswordInput/index.ts +1 -0
- package/template/src/components/RouteDialog/RouteDialog.tsx +20 -0
- package/template/src/components/RouteDialog/index.ts +2 -0
- package/template/src/components/RouteDialog/types.ts +8 -0
- package/template/src/components/RouteDialog/useRouteDialogNavigation.ts +30 -0
- package/template/src/components/SensitiveData/SensitiveData.tsx +337 -0
- package/template/src/components/SensitiveData/index.ts +2 -0
- package/template/src/components/SensitiveData/types.ts +31 -0
- package/template/src/components/StatusBadge/StatusBadge.tsx +28 -0
- package/template/src/components/StatusBadge/index.ts +2 -0
- package/template/src/components/StatusBadge/statusBadgeStyles.ts +30 -0
- package/template/src/components/StatusBadge/types.ts +7 -0
- package/template/src/components/layout/AppHeader/AppHeader.tsx +57 -0
- package/template/src/components/layout/AppHeader/HeaderSearch.tsx +160 -0
- package/template/src/components/layout/AppHeader/HeaderUserMenu.tsx +59 -0
- package/template/src/components/layout/AppHeader/ThemeControls.tsx +44 -0
- package/template/src/components/layout/AppHeader/index.ts +1 -0
- package/template/src/components/layout/AppHeader/themeOptions.ts +13 -0
- package/template/src/components/layout/AppSidebar.tsx +268 -0
- package/template/src/components/layout/PageContainer.tsx +16 -0
- package/template/src/components/ui/avatar.tsx +108 -0
- package/template/src/components/ui/badge.tsx +47 -0
- package/template/src/components/ui/button.tsx +63 -0
- package/template/src/components/ui/card.tsx +60 -0
- package/template/src/components/ui/checkbox.tsx +31 -0
- package/template/src/components/ui/collapsible.tsx +33 -0
- package/template/src/components/ui/command.tsx +181 -0
- package/template/src/components/ui/dialog.tsx +157 -0
- package/template/src/components/ui/dropdown-menu.tsx +254 -0
- package/template/src/components/ui/form.tsx +141 -0
- package/template/src/components/ui/input.tsx +20 -0
- package/template/src/components/ui/label.tsx +23 -0
- package/template/src/components/ui/pagination.tsx +127 -0
- package/template/src/components/ui/popover.tsx +41 -0
- package/template/src/components/ui/select.tsx +187 -0
- package/template/src/components/ui/separator.tsx +25 -0
- package/template/src/components/ui/sheet.tsx +142 -0
- package/template/src/components/ui/sidebar.tsx +878 -0
- package/template/src/components/ui/skeleton.tsx +13 -0
- package/template/src/components/ui/sonner.tsx +33 -0
- package/template/src/components/ui/tooltip.tsx +54 -0
- package/template/src/config/RuntimeConfigErrorPage.tsx +48 -0
- package/template/src/config/appConfig.ts +126 -0
- package/template/src/config/buildInfo.ts +8 -0
- package/template/src/config/observabilityAdapter.ts +8 -0
- package/template/src/config/runtimeConfig.ts +360 -0
- package/template/src/config/types.ts +195 -0
- package/template/src/context/ThemeProvider.tsx +84 -0
- package/template/src/context/UnsavedChangesProvider.tsx +123 -0
- package/template/src/context/applicationScope.ts +39 -0
- package/template/src/context/types.ts +41 -0
- package/template/src/dataMasking/index.ts +14 -0
- package/template/src/dataMasking/masking.ts +139 -0
- package/template/src/dataMasking/types.ts +144 -0
- package/template/src/featureFlags/FeatureFlagProvider.tsx +143 -0
- package/template/src/featureFlags/FeatureGate.tsx +12 -0
- package/template/src/featureFlags/catalog.ts +140 -0
- package/template/src/featureFlags/errors.ts +17 -0
- package/template/src/featureFlags/index.ts +43 -0
- package/template/src/featureFlags/query.ts +103 -0
- package/template/src/featureFlags/registry.ts +149 -0
- package/template/src/featureFlags/scope.ts +27 -0
- package/template/src/featureFlags/types.ts +241 -0
- package/template/src/features/auth/AuthLayout.tsx +17 -0
- package/template/src/features/auth/index.ts +2 -0
- package/template/src/features/auth/signIn/components/UserAuthForm.tsx +121 -0
- package/template/src/features/auth/signIn/index.tsx +71 -0
- package/template/src/features/auth/signIn/messages.ts +37 -0
- package/template/src/features/auth/signIn/types.ts +4 -0
- package/template/src/features/errors/ForbiddenError.tsx +34 -0
- package/template/src/features/errors/GeneralError.tsx +46 -0
- package/template/src/features/errors/MaintenanceError.tsx +31 -0
- package/template/src/features/errors/NotFoundError.tsx +34 -0
- package/template/src/features/errors/RouteError.tsx +72 -0
- package/template/src/features/errors/UnauthorizedError.tsx +34 -0
- package/template/src/features/errors/index.ts +6 -0
- package/template/src/features/errors/messages.ts +56 -0
- package/template/src/features/home/index.tsx +107 -0
- package/template/src/features/home/messages.ts +59 -0
- package/template/src/features/showcase/AccessShowcasePage.tsx +284 -0
- package/template/src/features/showcase/AdvancedTableDemo.tsx +120 -0
- package/template/src/features/showcase/FeedbackShowcasePage.tsx +142 -0
- package/template/src/features/showcase/FileShowcasePage.tsx +110 -0
- package/template/src/features/showcase/FormShowcasePage.tsx +156 -0
- package/template/src/features/showcase/MetadataShowcasePage.tsx +241 -0
- package/template/src/features/showcase/ShowcasePageHeader.tsx +24 -0
- package/template/src/features/showcase/TableShowcasePage.tsx +436 -0
- package/template/src/features/showcase/accessMessages.ts +67 -0
- package/template/src/features/showcase/index.ts +6 -0
- package/template/src/features/showcase/messages.ts +192 -0
- package/template/src/files/download.ts +82 -0
- package/template/src/files/errors.ts +15 -0
- package/template/src/files/filename.ts +61 -0
- package/template/src/files/index.ts +38 -0
- package/template/src/files/types.ts +299 -0
- package/template/src/files/useFileTask.ts +153 -0
- package/template/src/files/useFileUpload.ts +117 -0
- package/template/src/files/validation.ts +109 -0
- package/template/src/layouts/AppLayout.tsx +37 -0
- package/template/src/lib/accessControl.ts +42 -0
- package/template/src/lib/navigationRedirect.ts +26 -0
- package/template/src/lib/utils.ts +6 -0
- package/template/src/locale/LocaleProvider.tsx +37 -0
- package/template/src/locale/context.ts +15 -0
- package/template/src/locale/formatters.ts +123 -0
- package/template/src/locale/hooks.ts +35 -0
- package/template/src/locale/index.ts +17 -0
- package/template/src/locale/messages.ts +151 -0
- package/template/src/locale/types.ts +167 -0
- package/template/src/main.tsx +5 -0
- package/template/src/observability/browser.ts +37 -0
- package/template/src/observability/consoleAdapter.ts +18 -0
- package/template/src/observability/index.ts +26 -0
- package/template/src/observability/observer.ts +118 -0
- package/template/src/observability/redaction.ts +85 -0
- package/template/src/observability/types.ts +119 -0
- package/template/src/optionalEditors/controller.ts +327 -0
- package/template/src/optionalEditors/errors.ts +21 -0
- package/template/src/optionalEditors/index.ts +35 -0
- package/template/src/optionalEditors/model.ts +253 -0
- package/template/src/optionalEditors/react.ts +89 -0
- package/template/src/optionalEditors/types.ts +254 -0
- package/template/src/permissions/index.ts +3 -0
- package/template/src/permissions/types.ts +5 -0
- package/template/src/permissions/usePermission.ts +16 -0
- package/template/src/realtimeCollaboration/controller.ts +355 -0
- package/template/src/realtimeCollaboration/errors.ts +20 -0
- package/template/src/realtimeCollaboration/index.ts +39 -0
- package/template/src/realtimeCollaboration/model.ts +212 -0
- package/template/src/realtimeCollaboration/react.ts +72 -0
- package/template/src/realtimeCollaboration/types.ts +251 -0
- package/template/src/reporting/errors.ts +21 -0
- package/template/src/reporting/generation.ts +87 -0
- package/template/src/reporting/index.ts +42 -0
- package/template/src/reporting/model.ts +373 -0
- package/template/src/reporting/print.ts +16 -0
- package/template/src/reporting/query.ts +50 -0
- package/template/src/reporting/react.ts +17 -0
- package/template/src/reporting/source.ts +13 -0
- package/template/src/reporting/types.ts +219 -0
- package/template/src/router/RootRouteLayout.tsx +11 -0
- package/template/src/router/authLifecycle.ts +39 -0
- package/template/src/router/config.ts +293 -0
- package/template/src/router/interceptors.ts +48 -0
- package/template/src/router/lazyRouteComponents.ts +78 -0
- package/template/src/router/messages.ts +48 -0
- package/template/src/router/navigation.ts +167 -0
- package/template/src/router/router.ts +66 -0
- package/template/src/router/searchSchemas.ts +9 -0
- package/template/src/router/types.ts +76 -0
- package/template/src/stores/authSessionStorage.ts +27 -0
- package/template/src/stores/authStore.ts +165 -0
- package/template/src/stores/types.ts +36 -0
- package/template/src/stores/uiPreferenceStore.ts +34 -0
- package/template/src/styles/index.css +141 -0
- package/template/src/styles/theme.css +213 -0
- package/template/src/tenantWorkspace/TenantWorkspaceProvider.tsx +102 -0
- package/template/src/tenantWorkspace/index.ts +33 -0
- package/template/src/tenantWorkspace/store.ts +184 -0
- package/template/src/tenantWorkspace/switch.ts +206 -0
- package/template/src/tenantWorkspace/types.ts +155 -0
- package/template/src/vite-env.d.ts +20 -0
- package/template/stylelint.config.js +28 -0
- package/template/tests/integration/Application.test.tsx +269 -0
- package/template/tests/integration/layout/AppHeader.test.tsx +182 -0
- package/template/tests/integration/layout/AppSidebar.test.tsx +121 -0
- package/template/tests/integration/layout/__screenshots__/AppHeader.test.tsx/AppHeader-command-search-hides-the-duplicate-header-trigger-when-the-desktop-sidebar-collapses-1.png +0 -0
- package/template/tests/integration/router/__screenshots__/config.test.ts/route-tree-authentication-boundaries-exposes-only-scaffold-navigation-metadata-1.png +0 -0
- package/template/tests/integration/router/config.test.ts +123 -0
- package/template/tests/integration/router/interceptors.test.ts +100 -0
- package/template/tests/setup/accessibility.ts +25 -0
- package/template/tests/setup/runtimeConfig.ts +3 -0
- package/template/tests/unit/api/ApiError.test.ts +25 -0
- package/template/tests/unit/api/__screenshots__/authSession.test.ts/administrator-authentication-clears-the-session-if-a-refresh-identity-loses-administrator-access-1.png +0 -0
- package/template/tests/unit/api/__screenshots__/authSession.test.ts/administrator-authentication-creates-a-session-from-the-generated-login-response-for-an-admin-1.png +0 -0
- package/template/tests/unit/api/__screenshots__/authSession.test.ts/administrator-authentication-rejects-and-revokes-the-generated-login-result-for-an-ordinary-user-1.png +0 -0
- package/template/tests/unit/api/activity/ActivityProvider.test.tsx +131 -0
- package/template/tests/unit/api/activity/__screenshots__/transports.test.ts/activity-transport-adapters-polls-sequentially-and-advances-the-last-event-ID-1.png +0 -0
- package/template/tests/unit/api/activity/modelAndQuery.test.ts +144 -0
- package/template/tests/unit/api/activity/subscription.test.ts +103 -0
- package/template/tests/unit/api/activity/transports.test.ts +145 -0
- package/template/tests/unit/api/authClient.test.ts +110 -0
- package/template/tests/unit/api/authSession.test.ts +289 -0
- package/template/tests/unit/api/clients/configureApiClient.test.ts +198 -0
- package/template/tests/unit/api/demoAuthClient.test.ts +47 -0
- package/template/tests/unit/api/enums/access.test.ts +107 -0
- package/template/tests/unit/api/enums/catalog.test.ts +200 -0
- package/template/tests/unit/api/enums/query.test.ts +110 -0
- package/template/tests/unit/api/enums/useEnum.test.tsx +98 -0
- package/template/tests/unit/api/enums/useEnumCatalog.test.tsx +68 -0
- package/template/tests/unit/api/hooks/error.test.ts +168 -0
- package/template/tests/unit/api/hooks/request.test.ts +170 -0
- package/template/tests/unit/api/hooks/response.test.ts +46 -0
- package/template/tests/unit/api/metadata/MetadataProvider.test.tsx +102 -0
- package/template/tests/unit/api/parameters/catalog.test.ts +147 -0
- package/template/tests/unit/api/parameters/query.test.ts +78 -0
- package/template/tests/unit/api/parameters/useGlobalParameter.test.tsx +89 -0
- package/template/tests/unit/api/query/queryPolicy.test.ts +245 -0
- package/template/tests/unit/api/query/useAppQueryScope.test.tsx +74 -0
- package/template/tests/unit/auditLogs/auditLogHooks.test.tsx +194 -0
- package/template/tests/unit/auditLogs/auditLogs.test.ts +199 -0
- package/template/tests/unit/authentication/__screenshots__/authentication.test.ts/authentication-controller-completes-Step-up-callbacks-without-creating-a-second-login-result-1.png +0 -0
- package/template/tests/unit/authentication/__screenshots__/authentication.test.ts/authentication-controller-moves-from-challenge-to-completion-without-retaining-tokens-in-snapshot-1.png +0 -0
- package/template/tests/unit/authentication/authentication.test.ts +376 -0
- package/template/tests/unit/components/AppDialog.test.tsx +225 -0
- package/template/tests/unit/components/AppTable.test.tsx +129 -0
- package/template/tests/unit/components/AppTableLayoutTransition.test.ts +118 -0
- package/template/tests/unit/components/AppTableLocalization.test.ts +58 -0
- package/template/tests/unit/components/AppTableSensitiveData.test.ts +35 -0
- package/template/tests/unit/components/AppTableUpgrade.test.tsx +179 -0
- package/template/tests/unit/components/AppTableUpgradeCore.test.ts +258 -0
- package/template/tests/unit/components/BrandLogo.test.tsx +24 -0
- package/template/tests/unit/components/Can.test.tsx +80 -0
- package/template/tests/unit/components/Dialog.test.tsx +56 -0
- package/template/tests/unit/components/EnumPresentation.test.tsx +64 -0
- package/template/tests/unit/components/FilePreviewEngine.test.ts +51 -0
- package/template/tests/unit/components/JsonEditor.test.tsx +47 -0
- package/template/tests/unit/components/LocalizedSharedComponents.test.tsx +36 -0
- package/template/tests/unit/components/OverlayLayer.test.tsx +151 -0
- package/template/tests/unit/components/PageFeedback.test.tsx +143 -0
- package/template/tests/unit/components/PageForm.test.tsx +272 -0
- package/template/tests/unit/components/PageFormCore.test.ts +74 -0
- package/template/tests/unit/components/PasswordInput.test.tsx +105 -0
- package/template/tests/unit/components/ScaffoldComponents.test.tsx +64 -0
- package/template/tests/unit/components/SensitiveData.test.tsx +151 -0
- package/template/tests/unit/components/StatusBadge.test.tsx +36 -0
- package/template/tests/unit/components/TableComponent.test.tsx +644 -0
- package/template/tests/unit/components/TableCore.test.ts +145 -0
- package/template/tests/unit/components/ThemeAccessibility.test.tsx +27 -0
- package/template/tests/unit/components/__screenshots__/BatchOperationDialog.test.tsx/confirms-a-batch-action-and-presents-partial-failure-details-1.png +0 -0
- package/template/tests/unit/components/__screenshots__/PageForm.test.tsx/PageForm-writes-uploaded-values-through-the-public-file-field-and-resets-dirty-state-1.png +0 -0
- package/template/tests/unit/components/__screenshots__/PasswordInput.test.tsx/PasswordInput-toggles-the-password-visibility-when-the-show-password-button-is-clicked-1.png +0 -0
- package/template/tests/unit/components/__screenshots__/TableComponent.test.tsx/TableComponent-pins-trailing-action-columns-and-removes-their-header-menu-by-default-1.png +0 -0
- package/template/tests/unit/components/__screenshots__/TableComponent.test.tsx/TableComponent-renders-shadcn-components-through-cellComponent-1.png +0 -0
- package/template/tests/unit/components/__screenshots__/TableComponent.test.tsx/TableComponent-renders-the-toolbar-without-a-bottom-divider-1.png +0 -0
- package/template/tests/unit/components/__screenshots__/TableComponent.test.tsx/TableComponent-resyncs-adaptive-height-after-a-column-resize-changes-wrapped-row-height-1.png +0 -0
- package/template/tests/unit/config/RuntimeConfigErrorPage.test.tsx +23 -0
- package/template/tests/unit/config/appConfig.test.ts +98 -0
- package/template/tests/unit/config/appTableContracts.test.mjs +120 -0
- package/template/tests/unit/config/bundleBudget.test.mjs +190 -0
- package/template/tests/unit/config/componentGovernance.test.mjs +156 -0
- package/template/tests/unit/config/deployConfig.test.mjs +211 -0
- package/template/tests/unit/config/eslintConfig.test.mjs +101 -0
- package/template/tests/unit/config/featureBoundaries.test.mjs +126 -0
- package/template/tests/unit/config/npmPackage.test.mjs +37 -0
- package/template/tests/unit/config/releaseArtifact.test.mjs +105 -0
- package/template/tests/unit/config/runtimeConfig.test.ts +225 -0
- package/template/tests/unit/config/scaffoldCheck.test.mjs +53 -0
- package/template/tests/unit/config/scaffoldFeature.test.mjs +177 -0
- package/template/tests/unit/config/scaffoldInit.test.mjs +218 -0
- package/template/tests/unit/config/scaffoldProject.test.mjs +378 -0
- package/template/tests/unit/config/scaffoldTransaction.test.mjs +77 -0
- package/template/tests/unit/config/viteConfig.test.mjs +371 -0
- package/template/tests/unit/context/ThemeProvider.test.tsx +108 -0
- package/template/tests/unit/context/UnsavedChangesProvider.test.tsx +94 -0
- package/template/tests/unit/context/__screenshots__/ThemeProvider.test.tsx/ThemeProvider-uses-the-neutral-black-palette-for-the-app-and-scoped-table-theme-1.png +0 -0
- package/template/tests/unit/context/applicationScope.test.ts +62 -0
- package/template/tests/unit/dataMasking/dataMasking.test.ts +95 -0
- package/template/tests/unit/featureFlags/featureFlags.test.ts +169 -0
- package/template/tests/unit/featureFlags/useFeatureFlag.test.tsx +108 -0
- package/template/tests/unit/features/FeatureLocalization.test.tsx +54 -0
- package/template/tests/unit/features/RouteError.test.tsx +40 -0
- package/template/tests/unit/features/auth/signIn/UserAuthForm.test.tsx +79 -0
- package/template/tests/unit/features/auth/signIn/__screenshots__/UserAuthForm.test.tsx/UserAuthForm-passes-validated-values-to-onSubmit-1.png +0 -0
- package/template/tests/unit/features/auth/signIn/__screenshots__/UserAuthForm.test.tsx/UserAuthForm-shows-validation-messages-when-submitting-an-empty-form-1.png +0 -0
- package/template/tests/unit/files/fileHooks.test.tsx +130 -0
- package/template/tests/unit/files/files.test.ts +112 -0
- package/template/tests/unit/lib/accessControl.test.ts +69 -0
- package/template/tests/unit/locale/locale.test.tsx +90 -0
- package/template/tests/unit/observability/browser.test.ts +48 -0
- package/template/tests/unit/observability/observer.test.ts +115 -0
- package/template/tests/unit/optionalEditors/__screenshots__/useOptionalEditor.test.tsx/useOptionalEditor-fails-permission-precheck-before-loading-the-project-SDK-1.png +0 -0
- package/template/tests/unit/optionalEditors/__screenshots__/useOptionalEditor.test.tsx/useOptionalEditor-mounts-a-route-scoped-SDK-into-the-dedicated-host-with-permission-1.png +0 -0
- package/template/tests/unit/optionalEditors/optionalEditors.test.ts +313 -0
- package/template/tests/unit/optionalEditors/useOptionalEditor.test.tsx +141 -0
- package/template/tests/unit/realtimeCollaboration/collaboration.test.ts +240 -0
- package/template/tests/unit/realtimeCollaboration/useRealtimeCollaboration.test.tsx +115 -0
- package/template/tests/unit/reporting/reporting.test.ts +195 -0
- package/template/tests/unit/reporting/reportingHooks.test.tsx +203 -0
- package/template/tests/unit/router/authLifecycle.test.ts +55 -0
- package/template/tests/unit/router/navigation.test.ts +55 -0
- package/template/tests/unit/router/redirects.test.ts +22 -0
- package/template/tests/unit/scaffoldFeatureTemplate/featureTemplate.test.ts +42 -0
- package/template/tests/unit/scaffoldFeatureTemplate/publicContract.test.ts +28 -0
- package/template/tests/unit/scaffoldFeatureTemplate/queries.test.tsx +289 -0
- package/template/tests/unit/stores/authStore.test.ts +128 -0
- package/template/tests/unit/stores/uiPreferenceStore.test.ts +56 -0
- package/template/tests/unit/tenantWorkspace/tenantWorkspace.test.tsx +261 -0
- package/template/tools/bundle/budgets.json +48 -0
- package/template/tools/bundle/check.mjs +307 -0
- package/template/tools/component-governance/check.mjs +703 -0
- package/template/tools/component-governance/manifest.json +112 -0
- package/template/tools/deployment/browser-smoke.mjs +76 -0
- package/template/tools/deployment/browser-smoke.sh +141 -0
- package/template/tools/openapi/generate.mjs +268 -0
- package/template/tools/openapi/templates/README.md +14 -0
- package/template/tools/openapi/templates/base/README.md +7 -0
- package/template/tools/openapi/templates/base/data-contracts.eta +44 -0
- package/template/tools/openapi/templates/base/http-client.eta +3 -0
- package/template/tools/openapi/templates/base/http-clients/axios-http-client.eta +132 -0
- package/template/tools/openapi/templates/base/http-clients/fetch-http-client.eta +220 -0
- package/template/tools/openapi/templates/base/route-docs.eta +31 -0
- package/template/tools/openapi/templates/base/route-name.eta +43 -0
- package/template/tools/openapi/templates/base/route-type.eta +22 -0
- package/template/tools/openapi/templates/default/README.md +7 -0
- package/template/tools/openapi/templates/default/api.eta +67 -0
- package/template/tools/openapi/templates/default/http-client.eta +137 -0
- package/template/tools/openapi/templates/default/procedure-call.eta +99 -0
- package/template/tools/openapi/templates/default/route-docs.eta +40 -0
- package/template/tools/openapi/templates/default/route-types.eta +28 -0
- package/template/tools/openapi/templates/modular/README.md +7 -0
- package/template/tools/openapi/templates/modular/api.eta +28 -0
- package/template/tools/openapi/templates/modular/procedure-call.eta +99 -0
- package/template/tools/openapi/templates/modular/route-types.eta +18 -0
- package/template/tools/release/artifact.mjs +258 -0
- package/template/tools/scaffold/add-capability.mjs +409 -0
- package/template/tools/scaffold/capability-catalog.json +163 -0
- package/template/tools/scaffold/check.mjs +326 -0
- package/template/tools/scaffold/create-feature.mjs +444 -0
- package/template/tools/scaffold/create-project.mjs +482 -0
- package/template/tools/scaffold/init.example.json +64 -0
- package/template/tools/scaffold/init.mjs +419 -0
- package/template/tools/scaffold/lockfile.mjs +193 -0
- package/template/tools/scaffold/templates/feature/index.ts +19 -0
- package/template/tools/scaffold/templates/feature/model.ts +142 -0
- package/template/tools/scaffold/templates/feature/queries.ts +154 -0
- package/template/tools/scaffold/templates/feature/repository.ts +206 -0
- package/template/tools/scaffold/templates/feature/types.ts +168 -0
- package/template/tools/scaffold/workspace-transaction.mjs +111 -0
- package/template/tsconfig.app.json +31 -0
- package/template/tsconfig.json +12 -0
- package/template/tsconfig.node.json +24 -0
- package/template/vite.config.ts +121 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { fnCreateAppQueryScope } from './scope'
|
|
2
|
+
import type {
|
|
3
|
+
IAppQueryKeyFactory,
|
|
4
|
+
IAppQueryScope,
|
|
5
|
+
TAppQueryDetailKey,
|
|
6
|
+
TAppQueryDetailsKey,
|
|
7
|
+
TAppQueryEntityId,
|
|
8
|
+
TAppQueryFeatureKey,
|
|
9
|
+
TAppQueryListKey,
|
|
10
|
+
TAppQueryListsKey,
|
|
11
|
+
TAppQueryParameters,
|
|
12
|
+
TAppQueryParameterValue,
|
|
13
|
+
TAppQueryResourceKey,
|
|
14
|
+
TAppQueryScopeKey,
|
|
15
|
+
} from './types'
|
|
16
|
+
|
|
17
|
+
function fnNormalizeKeyName(strValue: string, strFieldName: string) {
|
|
18
|
+
const strNormalizedValue = strValue.trim()
|
|
19
|
+
if (!strNormalizedValue) {
|
|
20
|
+
throw new TypeError(`Query Key 字段 ${strFieldName} 不能为空。`)
|
|
21
|
+
}
|
|
22
|
+
return strNormalizedValue
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function fnNormalizeEntityId(objEntityId: TAppQueryEntityId) {
|
|
26
|
+
if (typeof objEntityId === 'number' && !Number.isFinite(objEntityId)) {
|
|
27
|
+
throw new TypeError('Query 详情实体标识必须是有限数字或非空字符串。')
|
|
28
|
+
}
|
|
29
|
+
if (typeof objEntityId === 'string') {
|
|
30
|
+
return fnNormalizeKeyName(objEntityId, 'objEntityId')
|
|
31
|
+
}
|
|
32
|
+
return objEntityId
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function fnNormalizeParameters(objParameters: TAppQueryParameters) {
|
|
36
|
+
const objNormalizedParameters: Record<string, TAppQueryParameterValue> = {}
|
|
37
|
+
Object.keys(objParameters)
|
|
38
|
+
.sort()
|
|
39
|
+
.forEach((strKey) => {
|
|
40
|
+
objNormalizedParameters[strKey] = fnNormalizeParameterValue(
|
|
41
|
+
objParameters[strKey],
|
|
42
|
+
strKey
|
|
43
|
+
)
|
|
44
|
+
})
|
|
45
|
+
return Object.freeze(objNormalizedParameters)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function fnIsParameterArray(
|
|
49
|
+
objValue: TAppQueryParameterValue
|
|
50
|
+
): objValue is readonly TAppQueryParameterValue[] {
|
|
51
|
+
return Array.isArray(objValue)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function fnNormalizeParameterValue(
|
|
55
|
+
objValue: TAppQueryParameterValue,
|
|
56
|
+
strPath: string
|
|
57
|
+
): TAppQueryParameterValue {
|
|
58
|
+
if (typeof objValue === 'number') {
|
|
59
|
+
if (!Number.isFinite(objValue)) {
|
|
60
|
+
throw new TypeError(
|
|
61
|
+
`Query 列表参数 ${strPath} 必须是可序列化的有限数字。`
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
return objValue
|
|
65
|
+
}
|
|
66
|
+
if (objValue === null || typeof objValue !== 'object') {
|
|
67
|
+
return objValue
|
|
68
|
+
}
|
|
69
|
+
if (fnIsParameterArray(objValue)) {
|
|
70
|
+
return Object.freeze(
|
|
71
|
+
objValue.map((objItem, nIndex) =>
|
|
72
|
+
fnNormalizeParameterValue(objItem, `${strPath}[${nIndex}]`)
|
|
73
|
+
)
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const objNormalizedValue: Record<string, TAppQueryParameterValue> = {}
|
|
78
|
+
Object.keys(objValue)
|
|
79
|
+
.sort()
|
|
80
|
+
.forEach((strKey) => {
|
|
81
|
+
objNormalizedValue[strKey] = fnNormalizeParameterValue(
|
|
82
|
+
objValue[strKey],
|
|
83
|
+
`${strPath}.${strKey}`
|
|
84
|
+
)
|
|
85
|
+
})
|
|
86
|
+
return Object.freeze(objNormalizedValue)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** 创建遵循 Feature、作用域、资源、列表/详情层级的 Query Key 工厂。 */
|
|
90
|
+
export function fnCreateAppQueryKeys(
|
|
91
|
+
strFeature: string,
|
|
92
|
+
objScopeInput: IAppQueryScope
|
|
93
|
+
): IAppQueryKeyFactory {
|
|
94
|
+
const strNormalizedFeature = fnNormalizeKeyName(strFeature, 'strFeature')
|
|
95
|
+
const objScope = fnCreateAppQueryScope(objScopeInput)
|
|
96
|
+
const arrAll: TAppQueryFeatureKey = ['appQuery', strNormalizedFeature]
|
|
97
|
+
const arrScope: TAppQueryScopeKey = [
|
|
98
|
+
'appQuery',
|
|
99
|
+
strNormalizedFeature,
|
|
100
|
+
objScope,
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
function fnResource(strResource: string): TAppQueryResourceKey {
|
|
104
|
+
const arrQueryKey: TAppQueryResourceKey = [
|
|
105
|
+
...arrScope,
|
|
106
|
+
fnNormalizeKeyName(strResource, 'strResource'),
|
|
107
|
+
]
|
|
108
|
+
return Object.freeze(arrQueryKey)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function fnLists(strResource: string): TAppQueryListsKey {
|
|
112
|
+
const arrQueryKey: TAppQueryListsKey = [...fnResource(strResource), 'list']
|
|
113
|
+
return Object.freeze(arrQueryKey)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function fnList(
|
|
117
|
+
strResource: string,
|
|
118
|
+
objParameters?: TAppQueryParameters
|
|
119
|
+
): TAppQueryListKey {
|
|
120
|
+
const arrLists = fnLists(strResource)
|
|
121
|
+
const arrQueryKey: TAppQueryListKey = objParameters
|
|
122
|
+
? [...arrLists, fnNormalizeParameters(objParameters)]
|
|
123
|
+
: arrLists
|
|
124
|
+
return Object.freeze(arrQueryKey)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function fnDetails(strResource: string): TAppQueryDetailsKey {
|
|
128
|
+
const arrQueryKey: TAppQueryDetailsKey = [
|
|
129
|
+
...fnResource(strResource),
|
|
130
|
+
'detail',
|
|
131
|
+
]
|
|
132
|
+
return Object.freeze(arrQueryKey)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function fnDetail(
|
|
136
|
+
strResource: string,
|
|
137
|
+
objEntityId: TAppQueryEntityId
|
|
138
|
+
): TAppQueryDetailKey {
|
|
139
|
+
const arrQueryKey: TAppQueryDetailKey = [
|
|
140
|
+
...fnDetails(strResource),
|
|
141
|
+
fnNormalizeEntityId(objEntityId),
|
|
142
|
+
]
|
|
143
|
+
return Object.freeze(arrQueryKey)
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return Object.freeze({
|
|
147
|
+
arrAll: Object.freeze(arrAll),
|
|
148
|
+
arrScope: Object.freeze(arrScope),
|
|
149
|
+
fnDetail,
|
|
150
|
+
fnDetails,
|
|
151
|
+
fnList,
|
|
152
|
+
fnLists,
|
|
153
|
+
fnResource,
|
|
154
|
+
})
|
|
155
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { hashKey, type QueryClient } from '@tanstack/react-query'
|
|
2
|
+
import type {
|
|
3
|
+
IAppMutationScope,
|
|
4
|
+
IAppQueryRollbackSnapshot,
|
|
5
|
+
TAppQueryKey,
|
|
6
|
+
TAppQueryUpdater,
|
|
7
|
+
} from './types'
|
|
8
|
+
|
|
9
|
+
/** 将同一资源或实体的 Mutation 放入同一个串行执行队列。 */
|
|
10
|
+
export function fnCreateAppMutationScope(
|
|
11
|
+
arrQueryKey: TAppQueryKey
|
|
12
|
+
): IAppMutationScope {
|
|
13
|
+
return Object.freeze({ id: `appMutation:${hashKey(arrQueryKey)}` })
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** 取消精确查询、保存旧值并写入乐观结果。 */
|
|
17
|
+
export async function fnApplyOptimisticQueryUpdate<TData>(
|
|
18
|
+
objQueryClient: QueryClient,
|
|
19
|
+
arrQueryKey: TAppQueryKey,
|
|
20
|
+
fnUpdate: TAppQueryUpdater<TData>
|
|
21
|
+
): Promise<IAppQueryRollbackSnapshot<TData>> {
|
|
22
|
+
await objQueryClient.cancelQueries({ exact: true, queryKey: arrQueryKey })
|
|
23
|
+
|
|
24
|
+
const objPreviousValue = objQueryClient.getQueryData<TData>(arrQueryKey)
|
|
25
|
+
const objSnapshot: IAppQueryRollbackSnapshot<TData> = {
|
|
26
|
+
arrQueryKey,
|
|
27
|
+
bHadData: objPreviousValue !== undefined,
|
|
28
|
+
value: objPreviousValue,
|
|
29
|
+
}
|
|
30
|
+
objQueryClient.setQueryData<TData>(arrQueryKey, fnUpdate(objPreviousValue))
|
|
31
|
+
return Object.freeze(objSnapshot)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Mutation 失败时恢复乐观更新前的数据;原查询不存在时删除临时缓存。 */
|
|
35
|
+
export function fnRollbackOptimisticQueryUpdate<TData>(
|
|
36
|
+
objQueryClient: QueryClient,
|
|
37
|
+
objSnapshot: IAppQueryRollbackSnapshot<TData>
|
|
38
|
+
) {
|
|
39
|
+
if (!objSnapshot.bHadData || objSnapshot.value === undefined) {
|
|
40
|
+
objQueryClient.removeQueries({
|
|
41
|
+
exact: true,
|
|
42
|
+
queryKey: objSnapshot.arrQueryKey,
|
|
43
|
+
})
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
objQueryClient.setQueryData<TData>(objSnapshot.arrQueryKey, objSnapshot.value)
|
|
48
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useMemo } from 'react'
|
|
2
|
+
import { useLocale } from '@/locale'
|
|
3
|
+
import { useAuthStore } from '@/stores/authStore'
|
|
4
|
+
import {
|
|
5
|
+
fnCreateApplicationScope,
|
|
6
|
+
fnResolveApplicationQueryScope,
|
|
7
|
+
} from '@/context/applicationScope'
|
|
8
|
+
import { fnCreateAppQueryScope } from './scope'
|
|
9
|
+
import type { IUseAppQueryScopeOptions } from './types'
|
|
10
|
+
|
|
11
|
+
/** 从认证状态和 Locale 唯一来源派生当前 Feature 的查询作用域。 */
|
|
12
|
+
export function useAppQueryScope(objOptions: IUseAppQueryScopeOptions = {}) {
|
|
13
|
+
const { strLocale } = useLocale()
|
|
14
|
+
const nSessionGeneration = useAuthStore(
|
|
15
|
+
(objState) => objState.nSessionGeneration
|
|
16
|
+
)
|
|
17
|
+
const strTenantId = useAuthStore((objState) => objState.objUser?.strTenantId)
|
|
18
|
+
const strUserId = useAuthStore((objState) => objState.objUser?.strId)
|
|
19
|
+
const { strWorkspaceId } = objOptions
|
|
20
|
+
|
|
21
|
+
return useMemo(
|
|
22
|
+
() =>
|
|
23
|
+
fnCreateAppQueryScope(
|
|
24
|
+
fnResolveApplicationQueryScope(
|
|
25
|
+
fnCreateApplicationScope({
|
|
26
|
+
nSessionGeneration,
|
|
27
|
+
strLocale,
|
|
28
|
+
strTenantId,
|
|
29
|
+
strUserId,
|
|
30
|
+
strWorkspaceId,
|
|
31
|
+
})
|
|
32
|
+
)
|
|
33
|
+
),
|
|
34
|
+
[nSessionGeneration, strLocale, strTenantId, strUserId, strWorkspaceId]
|
|
35
|
+
)
|
|
36
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { IAppQueryScope } from './types'
|
|
2
|
+
|
|
3
|
+
function fnNormalizeRequiredScopeValue(strValue: string, strFieldName: string) {
|
|
4
|
+
const strNormalizedValue = strValue.trim()
|
|
5
|
+
if (!strNormalizedValue) {
|
|
6
|
+
throw new TypeError(`Query 作用域字段 ${strFieldName} 不能为空。`)
|
|
7
|
+
}
|
|
8
|
+
return strNormalizedValue
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function fnNormalizeOptionalScopeValue(strValue: string | undefined) {
|
|
12
|
+
const strNormalizedValue = strValue?.trim()
|
|
13
|
+
return strNormalizedValue || undefined
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** 创建不含凭据、可安全用于缓存隔离的应用查询作用域。 */
|
|
17
|
+
export function fnCreateAppQueryScope(
|
|
18
|
+
objInput: IAppQueryScope
|
|
19
|
+
): IAppQueryScope {
|
|
20
|
+
if (
|
|
21
|
+
!Number.isInteger(objInput.nSessionGeneration) ||
|
|
22
|
+
objInput.nSessionGeneration < 0
|
|
23
|
+
) {
|
|
24
|
+
throw new TypeError('Query 作用域的会话版本必须是非负整数。')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const strTenantId = fnNormalizeOptionalScopeValue(objInput.strTenantId)
|
|
28
|
+
const strWorkspaceId = fnNormalizeOptionalScopeValue(objInput.strWorkspaceId)
|
|
29
|
+
const objScope: IAppQueryScope = {
|
|
30
|
+
nSessionGeneration: objInput.nSessionGeneration,
|
|
31
|
+
strLocale: objInput.strLocale,
|
|
32
|
+
strUserId: fnNormalizeRequiredScopeValue(objInput.strUserId, 'strUserId'),
|
|
33
|
+
...(strTenantId ? { strTenantId } : {}),
|
|
34
|
+
...(strWorkspaceId ? { strWorkspaceId } : {}),
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return Object.freeze(objScope)
|
|
38
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { TAppLocale } from '@/locale'
|
|
2
|
+
|
|
3
|
+
/** 可安全序列化到 Query Key 的标量值。 */
|
|
4
|
+
export type TAppQueryParameterScalar = boolean | number | string | null
|
|
5
|
+
|
|
6
|
+
/** 可安全序列化到 Query Key 的递归只读值。 */
|
|
7
|
+
export type TAppQueryParameterValue =
|
|
8
|
+
| TAppQueryParameterScalar
|
|
9
|
+
| readonly TAppQueryParameterValue[]
|
|
10
|
+
| { readonly [strKey: string]: TAppQueryParameterValue }
|
|
11
|
+
|
|
12
|
+
/** 列表筛选、排序和分页参数使用的只读 Query Key 对象。 */
|
|
13
|
+
export type TAppQueryParameters = Readonly<
|
|
14
|
+
Record<string, TAppQueryParameterValue>
|
|
15
|
+
>
|
|
16
|
+
|
|
17
|
+
/** 详情资源允许使用的稳定实体标识。 */
|
|
18
|
+
export type TAppQueryEntityId = number | string
|
|
19
|
+
|
|
20
|
+
/** 已标准化后可直接进入 Query Key 的完整应用查询作用域。 */
|
|
21
|
+
export interface IAppQueryScope {
|
|
22
|
+
/** 当前认证会话版本;登录、退出或授权上下文变化时递增。 */
|
|
23
|
+
readonly nSessionGeneration: number
|
|
24
|
+
/** 当前应用语言,用于隔离包含本地化内容的服务端数据。 */
|
|
25
|
+
readonly strLocale: TAppLocale
|
|
26
|
+
/** 当前用户的稳定标识;未登录请求统一使用 `anonymous`。 */
|
|
27
|
+
readonly strUserId: string
|
|
28
|
+
/** 当前租户标识;单租户系统可以不提供。 */
|
|
29
|
+
readonly strTenantId?: string
|
|
30
|
+
/** 当前组织、项目或工作空间标识;没有二级作用域时不提供。 */
|
|
31
|
+
readonly strWorkspaceId?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** React Feature 读取当前查询作用域时允许补充的上下文。 */
|
|
35
|
+
export interface IUseAppQueryScopeOptions {
|
|
36
|
+
/**
|
|
37
|
+
* 所属 Feature 已校验的工作空间稳定标识;省略时不启用二级作用域。
|
|
38
|
+
* 用户、租户和语言始终由应用状态提供。
|
|
39
|
+
*/
|
|
40
|
+
readonly strWorkspaceId?: string
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** 一个 Feature 在所有身份作用域下的查询根 Key。 */
|
|
44
|
+
export type TAppQueryFeatureKey = readonly ['appQuery', string]
|
|
45
|
+
|
|
46
|
+
/** 一个 Feature 在当前用户、租户、语言和会话下的查询根 Key。 */
|
|
47
|
+
export type TAppQueryScopeKey = readonly ['appQuery', string, IAppQueryScope]
|
|
48
|
+
|
|
49
|
+
/** 当前作用域下某类服务端资源的查询根 Key。 */
|
|
50
|
+
export type TAppQueryResourceKey = readonly [
|
|
51
|
+
'appQuery',
|
|
52
|
+
string,
|
|
53
|
+
IAppQueryScope,
|
|
54
|
+
string,
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
/** 当前资源全部列表查询的 Key。 */
|
|
58
|
+
export type TAppQueryListsKey = readonly [
|
|
59
|
+
'appQuery',
|
|
60
|
+
string,
|
|
61
|
+
IAppQueryScope,
|
|
62
|
+
string,
|
|
63
|
+
'list',
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
/** 当前资源某个列表查询的精确 Key。 */
|
|
67
|
+
export type TAppQueryListKey =
|
|
68
|
+
| TAppQueryListsKey
|
|
69
|
+
| readonly [
|
|
70
|
+
'appQuery',
|
|
71
|
+
string,
|
|
72
|
+
IAppQueryScope,
|
|
73
|
+
string,
|
|
74
|
+
'list',
|
|
75
|
+
TAppQueryParameters,
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
/** 当前资源全部详情查询的 Key。 */
|
|
79
|
+
export type TAppQueryDetailsKey = readonly [
|
|
80
|
+
'appQuery',
|
|
81
|
+
string,
|
|
82
|
+
IAppQueryScope,
|
|
83
|
+
string,
|
|
84
|
+
'detail',
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
/** 当前资源某个实体详情的精确 Key。 */
|
|
88
|
+
export type TAppQueryDetailKey = readonly [
|
|
89
|
+
'appQuery',
|
|
90
|
+
string,
|
|
91
|
+
IAppQueryScope,
|
|
92
|
+
string,
|
|
93
|
+
'detail',
|
|
94
|
+
TAppQueryEntityId,
|
|
95
|
+
]
|
|
96
|
+
|
|
97
|
+
/** Query 基础设施创建的全部合法 Key 形状。 */
|
|
98
|
+
export type TAppQueryKey =
|
|
99
|
+
| TAppQueryFeatureKey
|
|
100
|
+
| TAppQueryScopeKey
|
|
101
|
+
| TAppQueryResourceKey
|
|
102
|
+
| TAppQueryListKey
|
|
103
|
+
| TAppQueryDetailsKey
|
|
104
|
+
| TAppQueryDetailKey
|
|
105
|
+
|
|
106
|
+
/** 一个 Feature 使用的层级化 Query Key 工厂。 */
|
|
107
|
+
export interface IAppQueryKeyFactory {
|
|
108
|
+
/** 当前 Feature 的全部查询;只用于跨作用域清理或诊断。 */
|
|
109
|
+
readonly arrAll: TAppQueryFeatureKey
|
|
110
|
+
/** 当前身份作用域内该 Feature 的全部查询。 */
|
|
111
|
+
readonly arrScope: TAppQueryScopeKey
|
|
112
|
+
/** 创建某类资源的根 Key。 */
|
|
113
|
+
readonly fnResource: (strResource: string) => TAppQueryResourceKey
|
|
114
|
+
/** 创建某类资源全部列表查询的 Key。 */
|
|
115
|
+
readonly fnLists: (strResource: string) => TAppQueryListsKey
|
|
116
|
+
/** 创建带可序列化筛选、排序或分页参数的列表 Key。 */
|
|
117
|
+
readonly fnList: (
|
|
118
|
+
strResource: string,
|
|
119
|
+
objParameters?: TAppQueryParameters
|
|
120
|
+
) => TAppQueryListKey
|
|
121
|
+
/** 创建某类资源全部详情查询的 Key。 */
|
|
122
|
+
readonly fnDetails: (strResource: string) => TAppQueryDetailsKey
|
|
123
|
+
/** 创建某个稳定实体标识对应的详情 Key。 */
|
|
124
|
+
readonly fnDetail: (
|
|
125
|
+
strResource: string,
|
|
126
|
+
objEntityId: TAppQueryEntityId
|
|
127
|
+
) => TAppQueryDetailKey
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** TanStack Mutation 的同目标串行执行作用域。 */
|
|
131
|
+
export interface IAppMutationScope {
|
|
132
|
+
/** 由 Query Key 稳定派生的 Mutation 串行队列标识。 */
|
|
133
|
+
readonly id: string
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/** 一次乐观更新前保存的精确 Query 缓存快照。 */
|
|
137
|
+
export interface IAppQueryRollbackSnapshot<TData> {
|
|
138
|
+
/** 被乐观更新的精确 Query Key。 */
|
|
139
|
+
readonly arrQueryKey: TAppQueryKey
|
|
140
|
+
/** 更新前是否存在可恢复的缓存数据。 */
|
|
141
|
+
readonly bHadData: boolean
|
|
142
|
+
/** 更新前的缓存数据;原查询不存在时为 `undefined`。 */
|
|
143
|
+
readonly value: TData | undefined
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** 根据旧缓存计算乐观结果的纯更新函数。 */
|
|
147
|
+
export type TAppQueryUpdater<TData> = (value: TData | undefined) => TData
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import type { AxiosInstance } from 'axios'
|
|
2
|
+
|
|
3
|
+
/** API 失败所属的稳定类别,用于决定恢复方式而不是展示技术细节。 */
|
|
4
|
+
export type TApiErrorKind =
|
|
5
|
+
| 'client'
|
|
6
|
+
| 'http'
|
|
7
|
+
| 'invalid_response'
|
|
8
|
+
| 'network'
|
|
9
|
+
| 'timeout'
|
|
10
|
+
| 'unknown'
|
|
11
|
+
|
|
12
|
+
/** 创建标准 API 错误时允许写入的安全字段。 */
|
|
13
|
+
export interface IApiErrorOptions {
|
|
14
|
+
/** 面向用户和业务代码的错误文案,不能包含原始响应或凭据。 */
|
|
15
|
+
strMessage: string
|
|
16
|
+
/** 后端业务码或前端稳定错误码。 */
|
|
17
|
+
strCode: string
|
|
18
|
+
/** 失败类别。 */
|
|
19
|
+
strKind: TApiErrorKind
|
|
20
|
+
/** HTTP 状态码;网络错误和客户端错误可能不存在。 */
|
|
21
|
+
nStatus?: number
|
|
22
|
+
/** 服务端返回或客户端生成的请求关联 ID。 */
|
|
23
|
+
strRequestId?: string
|
|
24
|
+
/** 后端明确提供的字段校验明细;全局日志和提示不得默认展开。 */
|
|
25
|
+
objDetails?: unknown
|
|
26
|
+
/** 是否适合由用户或调用方再次尝试;不会自动触发重试。 */
|
|
27
|
+
bRetriable: boolean
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Swagger 响应信封字段由后端契约固定为 data。
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
32
|
+
export type TApiEnvelope<T> = { data?: T }
|
|
33
|
+
|
|
34
|
+
export interface IAuthIdentityResult {
|
|
35
|
+
/** 后端授予的稳定权限码集合;省略表示刷新时沿用现有值。 */
|
|
36
|
+
arrPermissions?: string[]
|
|
37
|
+
/** 后端授予的角色编码集合;省略表示刷新时沿用现有值。 */
|
|
38
|
+
arrRoleCodes?: string[]
|
|
39
|
+
/** 当前用户稳定唯一标识。 */
|
|
40
|
+
strId?: string
|
|
41
|
+
/** 可安全展示的脱敏登录账号。 */
|
|
42
|
+
strMaskedPhone?: string
|
|
43
|
+
/** 当前用户展示名称。 */
|
|
44
|
+
strNickname?: string
|
|
45
|
+
/** 当前用户所属组织的展示名称。 */
|
|
46
|
+
strOrganizationName?: string
|
|
47
|
+
/** 后端返回的可选身份类型;应用授权应使用权限码而不是硬编码该字段。 */
|
|
48
|
+
strRole?: string
|
|
49
|
+
/** 当前租户稳定标识,用于缓存与数据隔离。 */
|
|
50
|
+
strTenantId?: string
|
|
51
|
+
/** 当前用户头像地址。 */
|
|
52
|
+
strAvatarUrl?: string
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** 登录错误读取器使用的本地化回退文案。 */
|
|
56
|
+
export interface IAuthErrorMessages {
|
|
57
|
+
/** 无法从错误对象读取安全消息时使用。 */
|
|
58
|
+
strFallbackMessage: string
|
|
59
|
+
/** 认证服务没有返回 HTTP 响应时使用。 */
|
|
60
|
+
strNetworkMessage: string
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface IAuthTokenResult {
|
|
64
|
+
/** 后端签发的短期访问令牌。 */
|
|
65
|
+
strAccessToken: string
|
|
66
|
+
/** 后端签发或滚动更新的刷新令牌。 */
|
|
67
|
+
strRefreshToken: string
|
|
68
|
+
/** 访问令牌有效期,单位为秒。 */
|
|
69
|
+
nExpiresIn?: number
|
|
70
|
+
/** 刷新会话空闲有效期,单位为秒。 */
|
|
71
|
+
nRefreshIdleExpiresIn?: number
|
|
72
|
+
/** 刷新令牌绝对有效期,单位为秒。 */
|
|
73
|
+
nRefreshExpiresIn?: number
|
|
74
|
+
/** 登录或刷新时返回的身份与授权快照。 */
|
|
75
|
+
objUser?: IAuthIdentityResult
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface IAuthSignInInput {
|
|
79
|
+
/** 令牌预期使用方。 */
|
|
80
|
+
strAudience: string
|
|
81
|
+
/** 浏览器应用的公开 OAuth Client ID。 */
|
|
82
|
+
strClientId: string
|
|
83
|
+
/** 用户输入的登录密码,不得记录或持久化。 */
|
|
84
|
+
strPassword: string
|
|
85
|
+
/** 用户输入的登录手机号。 */
|
|
86
|
+
strPhone: string
|
|
87
|
+
/** 本次登录申请的 OAuth Scope。 */
|
|
88
|
+
strScope: string
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface IAuthRefreshInput {
|
|
92
|
+
/** 浏览器应用的公开 OAuth Client ID。 */
|
|
93
|
+
strClientId: string
|
|
94
|
+
/** 当前会话刷新令牌,不得记录到日志。 */
|
|
95
|
+
strRefreshToken: string
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface IAuthSignOutInput {
|
|
99
|
+
/** 需要由后端撤销的刷新令牌。 */
|
|
100
|
+
strRefreshToken: string
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface IAuthApiClient {
|
|
104
|
+
/** 使用第一方凭据建立认证会话。 */
|
|
105
|
+
fnFirstPartyLogin: (objInput: IAuthSignInInput) => Promise<IAuthTokenResult>
|
|
106
|
+
/** 在当前会话内刷新令牌和可选的授权快照。 */
|
|
107
|
+
fnRefreshToken: (
|
|
108
|
+
objInput: IAuthRefreshInput,
|
|
109
|
+
objSignal: AbortSignal
|
|
110
|
+
) => Promise<IAuthTokenResult>
|
|
111
|
+
/** 撤销后端刷新会话。 */
|
|
112
|
+
fnSignOut: (objInput: IAuthSignOutInput) => Promise<void>
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface IGeneratedApiClient {
|
|
116
|
+
/** 由 swagger-typescript-api 生成客户端暴露的 Axios 实例。 */
|
|
117
|
+
instance: AxiosInstance
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
declare module 'axios' {
|
|
121
|
+
interface AxiosRequestConfig {
|
|
122
|
+
/** 成功后交给应用消息层展示的文案。 */
|
|
123
|
+
strSuccessMessage?: string
|
|
124
|
+
/** 是否向应用错误处理器报告错误,默认开启。 */
|
|
125
|
+
bShowError?: boolean
|
|
126
|
+
/** 当前请求的关联 ID;未提供时由请求 Hook 自动生成。 */
|
|
127
|
+
strRequestId?: string
|
|
128
|
+
/** 同一次写操作在首次提交、重试和结果确认间复用的幂等键。 */
|
|
129
|
+
strIdempotencyKey?: string
|
|
130
|
+
/** 单个请求的加载状态回调。 */
|
|
131
|
+
fnProgress?: (bLoading: boolean) => void
|
|
132
|
+
/** 单个请求覆盖默认请求处理的回调。 */
|
|
133
|
+
fnBeforeRequest?: (
|
|
134
|
+
objRequest: import('axios').InternalAxiosRequestConfig
|
|
135
|
+
) => void
|
|
136
|
+
/** 单个请求的响应观察回调。 */
|
|
137
|
+
fnBeforeResponse?: (objResponse: import('axios').AxiosResponse) => void
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
interface AxiosResponse {
|
|
141
|
+
/** 服务端响应头中的请求 ID,不存在时回退到客户端请求 ID。 */
|
|
142
|
+
strRequestId?: string
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { TAppLocale, TSharedMessageOverrides } from '@/locale'
|
|
2
|
+
import type { IEnumCatalogScopeContext, IEnumCatalogSource } from '@/api/enums'
|
|
3
|
+
import type {
|
|
4
|
+
IGlobalParameterScopeContext,
|
|
5
|
+
IGlobalParameterSource,
|
|
6
|
+
} from '@/api/parameters'
|
|
7
|
+
|
|
8
|
+
/** 全局枚举能力的应用级配置。 */
|
|
9
|
+
export interface IApplicationEnumCatalogOptions {
|
|
10
|
+
/** 是否允许加载全局枚举;默认仅在认证完成后启用。 */
|
|
11
|
+
readonly bIsEnabled?: boolean
|
|
12
|
+
/** 枚举命名空间或身份作用域覆盖。 */
|
|
13
|
+
readonly objScope?: IEnumCatalogScopeContext
|
|
14
|
+
/** 由 Swagger 生成客户端适配的后端数据源。 */
|
|
15
|
+
readonly objSource?: IEnumCatalogSource
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** 全局参数能力的应用级配置。 */
|
|
19
|
+
export interface IApplicationGlobalParameterOptions {
|
|
20
|
+
/** 是否允许加载全局参数;默认仅在认证完成后启用。 */
|
|
21
|
+
readonly bIsEnabled?: boolean
|
|
22
|
+
/** 参数命名空间或身份作用域覆盖。 */
|
|
23
|
+
readonly objScope?: IGlobalParameterScopeContext
|
|
24
|
+
/** 由 Swagger 生成客户端适配的后端数据源。 */
|
|
25
|
+
readonly objSource?: IGlobalParameterSource
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** 后端元数据能力的应用级配置。 */
|
|
29
|
+
export interface IApplicationMetadataOptions {
|
|
30
|
+
/** 全局枚举目录配置。 */
|
|
31
|
+
readonly objEnumCatalog?: IApplicationEnumCatalogOptions
|
|
32
|
+
/** 全局参数目录配置。 */
|
|
33
|
+
readonly objGlobalParameters?: IApplicationGlobalParameterOptions
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** 语言、时区和共享文案的应用级配置。 */
|
|
37
|
+
export interface IApplicationLocaleOptions {
|
|
38
|
+
/** 应用、共享模块和后端元数据共同使用的语言。 */
|
|
39
|
+
readonly strLocale?: TAppLocale
|
|
40
|
+
/** 应用统一 IANA 时区。 */
|
|
41
|
+
readonly strTimeZone?: string
|
|
42
|
+
/** 项目对共享壳层文案的按语言覆盖。 */
|
|
43
|
+
readonly objSharedMessages?: TSharedMessageOverrides
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** 应用根组合点的稳定配置。 */
|
|
47
|
+
export interface IApplicationOptions {
|
|
48
|
+
/** 语言、时区与共享文案。 */
|
|
49
|
+
readonly objLocale?: IApplicationLocaleOptions
|
|
50
|
+
/** 全局枚举和参数能力。 */
|
|
51
|
+
readonly objMetadata?: IApplicationMetadataOptions
|
|
52
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TAuditLogErrorCode } from './types'
|
|
2
|
+
|
|
3
|
+
/** 可由审计 Feature、日志和测试稳定分类的边界错误。 */
|
|
4
|
+
export class AuditLogError extends Error {
|
|
5
|
+
/** 稳定错误码。 */
|
|
6
|
+
readonly strCode: TAuditLogErrorCode
|
|
7
|
+
|
|
8
|
+
constructor(
|
|
9
|
+
strCode: TAuditLogErrorCode,
|
|
10
|
+
strMessage: string,
|
|
11
|
+
objOptions?: ErrorOptions
|
|
12
|
+
) {
|
|
13
|
+
super(strMessage, objOptions)
|
|
14
|
+
this.name = 'AuditLogError'
|
|
15
|
+
this.strCode = strCode
|
|
16
|
+
}
|
|
17
|
+
}
|