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,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"components": [
|
|
4
|
+
{
|
|
5
|
+
"name": "AppPageForm",
|
|
6
|
+
"localPath": "src/components/AppPageForm",
|
|
7
|
+
"publicEntry": "src/components/AppPageForm/index.ts",
|
|
8
|
+
"sourceNote": "src/components/AppPageForm/SOURCE.md",
|
|
9
|
+
"source": {
|
|
10
|
+
"repository": "frontend/package/page-form",
|
|
11
|
+
"revision": "d18a96435fa48724763026b4c95d207a61935efa",
|
|
12
|
+
"packageVersion": "0.1.0",
|
|
13
|
+
"importedAt": "2026-08-26",
|
|
14
|
+
"includedPaths": ["packages/core/src", "packages/react/src"],
|
|
15
|
+
"excludedCapabilities": [
|
|
16
|
+
"Vue adapter",
|
|
17
|
+
"examples",
|
|
18
|
+
"publishing configuration",
|
|
19
|
+
"repository tooling"
|
|
20
|
+
],
|
|
21
|
+
"license": {
|
|
22
|
+
"status": "not-provided",
|
|
23
|
+
"distributionPolicy": "internal-only"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"localAdaptations": [
|
|
27
|
+
"flattened core/react package layers into one application component",
|
|
28
|
+
"uses the application Locale and unsaved-changes providers",
|
|
29
|
+
"reuses the global FileUpload and UI primitives"
|
|
30
|
+
],
|
|
31
|
+
"regressionTests": [
|
|
32
|
+
"tests/unit/components/PageFormCore.test.ts",
|
|
33
|
+
"tests/unit/components/PageForm.test.tsx"
|
|
34
|
+
],
|
|
35
|
+
"requiredCommands": ["pnpm components:check", "pnpm verify"]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "AppTable",
|
|
39
|
+
"localPath": "src/components/AppTable",
|
|
40
|
+
"publicEntry": "src/components/AppTable/index.ts",
|
|
41
|
+
"sourceNote": "src/components/AppTable/SOURCE.md",
|
|
42
|
+
"source": {
|
|
43
|
+
"repository": "frontend/package/table-component",
|
|
44
|
+
"revision": "496e8740933c7748ce22bc1ad05499ee1e9ba7ec",
|
|
45
|
+
"packageVersion": "0.5.13",
|
|
46
|
+
"importedAt": "2026-09-02",
|
|
47
|
+
"includedPaths": ["packages/core/src", "packages/react/src"],
|
|
48
|
+
"excludedCapabilities": [
|
|
49
|
+
"Vue adapter",
|
|
50
|
+
"examples",
|
|
51
|
+
"publishing configuration",
|
|
52
|
+
"copied shadcn primitives",
|
|
53
|
+
"repository tooling"
|
|
54
|
+
],
|
|
55
|
+
"license": {
|
|
56
|
+
"status": "not-provided",
|
|
57
|
+
"distributionPolicy": "internal-only"
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"localAdaptations": [
|
|
61
|
+
"keeps framework-independent behavior in engine",
|
|
62
|
+
"groups React code by table domain instead of package layers",
|
|
63
|
+
"reuses global UI primitives and the central Handsontable license resolver",
|
|
64
|
+
"retains reactive Locale messages, sensitive columns and unsaved-changes protection",
|
|
65
|
+
"uses application Tailwind Preflight instead of package-only base.css; omits unused controlled-settings builder",
|
|
66
|
+
"commits layout callback refs in layout effects and tracks height readiness in React state"
|
|
67
|
+
],
|
|
68
|
+
"regressionTests": [
|
|
69
|
+
"tests/unit/components/AppTable.test.tsx",
|
|
70
|
+
"tests/unit/components/AppTableLocalization.test.ts",
|
|
71
|
+
"tests/unit/components/TableComponent.test.tsx",
|
|
72
|
+
"tests/unit/components/AppTableUpgrade.test.tsx",
|
|
73
|
+
"tests/unit/components/AppTableUpgradeCore.test.ts",
|
|
74
|
+
"tests/unit/components/AppTableLayoutTransition.test.ts",
|
|
75
|
+
"tests/unit/config/appTableContracts.test.mjs",
|
|
76
|
+
"tests/unit/config/viteConfig.test.mjs"
|
|
77
|
+
],
|
|
78
|
+
"requiredCommands": ["pnpm components:check", "pnpm verify"]
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"thirdParty": [
|
|
82
|
+
{
|
|
83
|
+
"packageName": "handsontable",
|
|
84
|
+
"expectedVersion": "18.0.0",
|
|
85
|
+
"expectedLicense": "SEE LICENSE IN LICENSE.txt",
|
|
86
|
+
"licenseFile": "LICENSE.txt",
|
|
87
|
+
"usedBy": ["AppTable"],
|
|
88
|
+
"productionPolicy": "commercial-key-required",
|
|
89
|
+
"policyEvidence": [
|
|
90
|
+
{
|
|
91
|
+
"path": "build/advancedTable.ts",
|
|
92
|
+
"markers": ["APP_TABLE_LICENSE_REQUIRED", "APP_TABLE_EAGER_LOAD"]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"path": "tests/unit/config/viteConfig.test.mjs",
|
|
96
|
+
"markers": [
|
|
97
|
+
"production does not silently accept the Handsontable evaluation license"
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"packageName": "exceljs",
|
|
104
|
+
"expectedVersion": "4.4.0",
|
|
105
|
+
"expectedLicense": "MIT",
|
|
106
|
+
"licenseFile": "LICENSE",
|
|
107
|
+
"usedBy": ["AppTable"],
|
|
108
|
+
"productionPolicy": "retain-license-notice",
|
|
109
|
+
"policyEvidence": []
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { mkdir, writeFile } from 'node:fs/promises'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import { chromium } from 'playwright'
|
|
4
|
+
|
|
5
|
+
const nNavigationTimeout = 15_000
|
|
6
|
+
|
|
7
|
+
const fnFail = (strCode, strMessage) => {
|
|
8
|
+
throw new TypeError(`[${strCode}] ${strMessage}`)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const fnValidateTargetUrl = (strValue) => {
|
|
12
|
+
let objUrl
|
|
13
|
+
try {
|
|
14
|
+
objUrl = new URL(strValue)
|
|
15
|
+
} catch {
|
|
16
|
+
fnFail(
|
|
17
|
+
'DEPLOY_BROWSER_SMOKE_ARGUMENT_INVALID',
|
|
18
|
+
'请提供有效的候选应用 URL。'
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
if (!['http:', 'https:'].includes(objUrl.protocol)) {
|
|
22
|
+
fnFail(
|
|
23
|
+
'DEPLOY_BROWSER_SMOKE_ARGUMENT_INVALID',
|
|
24
|
+
'候选应用 URL 必须使用 HTTP 或 HTTPS。'
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
return objUrl.href
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const fnWriteDom = async (strOutputFile, strDom) => {
|
|
31
|
+
if (!strOutputFile) return
|
|
32
|
+
await mkdir(path.dirname(path.resolve(strOutputFile)), { recursive: true })
|
|
33
|
+
await writeFile(strOutputFile, strDom, 'utf8')
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const fnRun = async () => {
|
|
37
|
+
const strTargetUrl = fnValidateTargetUrl(process.argv[2] ?? '')
|
|
38
|
+
const strOutputFile = process.argv[3]
|
|
39
|
+
const objBrowser = await chromium.launch({ headless: true })
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
const objPage = await objBrowser.newPage()
|
|
43
|
+
const objResponse = await objPage.goto(strTargetUrl, {
|
|
44
|
+
timeout: nNavigationTimeout,
|
|
45
|
+
waitUntil: 'domcontentloaded',
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
if (!objResponse?.ok()) {
|
|
49
|
+
fnFail(
|
|
50
|
+
'DEPLOY_BROWSER_SMOKE_NAVIGATION_FAILED',
|
|
51
|
+
`候选应用返回 HTTP ${objResponse?.status() ?? 'unknown'}。`
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
await objPage.locator('form').first().waitFor({
|
|
57
|
+
state: 'visible',
|
|
58
|
+
timeout: nNavigationTimeout,
|
|
59
|
+
})
|
|
60
|
+
} catch {
|
|
61
|
+
const strDom = await objPage.content()
|
|
62
|
+
await fnWriteDom(strOutputFile, strDom)
|
|
63
|
+
fnFail(
|
|
64
|
+
'DEPLOY_BROWSER_SMOKE_APP_NOT_READY',
|
|
65
|
+
'候选应用没有渲染登录表单;请检查 Runtime Config、React 启动、路由和静态资源。'
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
await fnWriteDom(strOutputFile, await objPage.content())
|
|
70
|
+
process.stdout.write(`候选应用浏览器冒烟通过:${strTargetUrl}\n`)
|
|
71
|
+
} finally {
|
|
72
|
+
await objBrowser.close()
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
await fnRun()
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
set -eu
|
|
4
|
+
|
|
5
|
+
strTargetUrl=${1:-}
|
|
6
|
+
strOutputFile=${2:-}
|
|
7
|
+
strBrowserPath=${BROWSER_EXECUTABLE_PATH:-}
|
|
8
|
+
bRemoveOutput=false
|
|
9
|
+
nBrowserPid=
|
|
10
|
+
nWatchdogPid=
|
|
11
|
+
strBrowserLog=
|
|
12
|
+
strTimeoutMarker=
|
|
13
|
+
|
|
14
|
+
fnFail() {
|
|
15
|
+
strCode=$1
|
|
16
|
+
strMessage=$2
|
|
17
|
+
printf '[%s] %s\n' "$strCode" "$strMessage" >&2
|
|
18
|
+
exit 1
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if [ -z "$strTargetUrl" ]; then
|
|
22
|
+
fnFail \
|
|
23
|
+
'DEPLOY_BROWSER_SMOKE_ARGUMENT_INVALID' \
|
|
24
|
+
'请提供候选应用 URL,例如 http://127.0.0.1/sign-in。'
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
case "$strTargetUrl" in
|
|
28
|
+
http://* | https://*) ;;
|
|
29
|
+
*)
|
|
30
|
+
fnFail \
|
|
31
|
+
'DEPLOY_BROWSER_SMOKE_ARGUMENT_INVALID' \
|
|
32
|
+
'候选应用 URL 必须使用 HTTP 或 HTTPS。'
|
|
33
|
+
;;
|
|
34
|
+
esac
|
|
35
|
+
|
|
36
|
+
if [ -z "$strBrowserPath" ]; then
|
|
37
|
+
strBrowserPath=$(find /ms-playwright -type f \
|
|
38
|
+
\( -name headless_shell -o -path '*/chrome-linux/chrome' \) \
|
|
39
|
+
-perm -111 2>/dev/null | head -n 1 || true)
|
|
40
|
+
fi
|
|
41
|
+
|
|
42
|
+
if [ -z "$strBrowserPath" ] || [ ! -x "$strBrowserPath" ]; then
|
|
43
|
+
fnFail \
|
|
44
|
+
'DEPLOY_BROWSER_SMOKE_BROWSER_MISSING' \
|
|
45
|
+
'没有找到可执行的 Chromium;请设置 BROWSER_EXECUTABLE_PATH。'
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
if [ -z "$strOutputFile" ]; then
|
|
49
|
+
strOutputFile=$(mktemp)
|
|
50
|
+
bRemoveOutput=true
|
|
51
|
+
else
|
|
52
|
+
mkdir -p "$(dirname "$strOutputFile")"
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
strBrowserProfile=$(mktemp -d)
|
|
56
|
+
strBrowserLog=$(mktemp)
|
|
57
|
+
strTimeoutMarker=$(mktemp)
|
|
58
|
+
rm -f "$strTimeoutMarker"
|
|
59
|
+
|
|
60
|
+
fnCleanup() {
|
|
61
|
+
if [ -n "$nWatchdogPid" ]; then
|
|
62
|
+
kill "$nWatchdogPid" 2>/dev/null || true
|
|
63
|
+
fi
|
|
64
|
+
if [ -n "$nBrowserPid" ]; then
|
|
65
|
+
kill "$nBrowserPid" 2>/dev/null || true
|
|
66
|
+
fi
|
|
67
|
+
rm -rf "$strBrowserProfile"
|
|
68
|
+
rm -f "$strBrowserLog" "$strTimeoutMarker"
|
|
69
|
+
if [ "$bRemoveOutput" = true ]; then
|
|
70
|
+
rm -f "$strOutputFile"
|
|
71
|
+
fi
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
fnHandleSignal() {
|
|
75
|
+
fnCleanup
|
|
76
|
+
exit 130
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
trap fnCleanup EXIT
|
|
80
|
+
trap fnHandleSignal HUP INT TERM
|
|
81
|
+
|
|
82
|
+
"$strBrowserPath" \
|
|
83
|
+
--headless \
|
|
84
|
+
--no-sandbox \
|
|
85
|
+
--disable-background-networking \
|
|
86
|
+
--disable-component-update \
|
|
87
|
+
--disable-default-apps \
|
|
88
|
+
--disable-dev-shm-usage \
|
|
89
|
+
--disable-gpu \
|
|
90
|
+
--disable-sync \
|
|
91
|
+
--metrics-recording-only \
|
|
92
|
+
--no-first-run \
|
|
93
|
+
--safebrowsing-disable-auto-update \
|
|
94
|
+
--user-data-dir="$strBrowserProfile" \
|
|
95
|
+
--timeout=10000 \
|
|
96
|
+
--dump-dom \
|
|
97
|
+
"$strTargetUrl" > "$strOutputFile" 2> "$strBrowserLog" &
|
|
98
|
+
nBrowserPid=$!
|
|
99
|
+
|
|
100
|
+
(
|
|
101
|
+
sleep 20
|
|
102
|
+
if kill -0 "$nBrowserPid" 2>/dev/null; then
|
|
103
|
+
: > "$strTimeoutMarker"
|
|
104
|
+
kill "$nBrowserPid" 2>/dev/null || true
|
|
105
|
+
sleep 2
|
|
106
|
+
kill -9 "$nBrowserPid" 2>/dev/null || true
|
|
107
|
+
fi
|
|
108
|
+
) &
|
|
109
|
+
nWatchdogPid=$!
|
|
110
|
+
|
|
111
|
+
nBrowserStatus=0
|
|
112
|
+
wait "$nBrowserPid" || nBrowserStatus=$?
|
|
113
|
+
kill "$nWatchdogPid" 2>/dev/null || true
|
|
114
|
+
wait "$nWatchdogPid" 2>/dev/null || true
|
|
115
|
+
nBrowserPid=
|
|
116
|
+
nWatchdogPid=
|
|
117
|
+
|
|
118
|
+
if grep -Eq '<form([[:space:]>])' "$strOutputFile"; then
|
|
119
|
+
printf '候选应用浏览器冒烟通过:%s\n' "$strTargetUrl"
|
|
120
|
+
exit 0
|
|
121
|
+
fi
|
|
122
|
+
|
|
123
|
+
if [ -f "$strTimeoutMarker" ]; then
|
|
124
|
+
fnFail \
|
|
125
|
+
'DEPLOY_BROWSER_SMOKE_TIMEOUT' \
|
|
126
|
+
'Chromium 在 20 秒内没有完成候选应用检查。'
|
|
127
|
+
fi
|
|
128
|
+
|
|
129
|
+
if [ "$nBrowserStatus" -ne 0 ]; then
|
|
130
|
+
sed -n '1,80p' "$strBrowserLog" >&2
|
|
131
|
+
fnFail \
|
|
132
|
+
'DEPLOY_BROWSER_SMOKE_NAVIGATION_FAILED' \
|
|
133
|
+
'Chromium 无法完成候选应用导航。'
|
|
134
|
+
fi
|
|
135
|
+
|
|
136
|
+
printf '%s\n' \
|
|
137
|
+
'[DEPLOY_BROWSER_SMOKE_APP_NOT_READY] 候选应用没有渲染登录表单。' \
|
|
138
|
+
'runtime-config.json 可能不符合应用契约,或 React 启动、路由和静态资源加载失败。' >&2
|
|
139
|
+
printf '%s\n' '候选页面 DOM(最多 120 行):' >&2
|
|
140
|
+
sed -n '1,120p' "$strOutputFile" >&2
|
|
141
|
+
exit 1
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { loadEnv } from 'vite'
|
|
2
|
+
import axios from 'axios'
|
|
3
|
+
import { mkdir, mkdtemp, readFile, rename, rm } from 'node:fs/promises'
|
|
4
|
+
import https from 'node:https'
|
|
5
|
+
import path from 'node:path'
|
|
6
|
+
import { fileURLToPath } from 'node:url'
|
|
7
|
+
import { generateApi } from 'swagger-typescript-api'
|
|
8
|
+
|
|
9
|
+
const strCurrentDir = path.dirname(fileURLToPath(import.meta.url))
|
|
10
|
+
const strProjectRoot = path.resolve(strCurrentDir, '../..')
|
|
11
|
+
|
|
12
|
+
const fnReadArg = (strName) => {
|
|
13
|
+
const nIndex = process.argv.indexOf(`--${strName}`)
|
|
14
|
+
return nIndex >= 0 ? process.argv[nIndex + 1] : undefined
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const strMode = fnReadArg('mode') || process.env.NODE_ENV || 'development'
|
|
18
|
+
const objEnv = loadEnv(strMode, strProjectRoot, '')
|
|
19
|
+
const strRequestedName = fnReadArg('name')
|
|
20
|
+
const strExplicitUrl = fnReadArg('url')
|
|
21
|
+
const objServiceNamePattern = /^[a-z][a-z0-9-]*$/
|
|
22
|
+
const objEnvNamePattern = /^VITE_[A-Z0-9_]+$/
|
|
23
|
+
const strServiceConfigPath = path.resolve(
|
|
24
|
+
strProjectRoot,
|
|
25
|
+
'src/api/config/services.json'
|
|
26
|
+
)
|
|
27
|
+
const strOutputRoot = path.resolve(strProjectRoot, 'src/api/generated')
|
|
28
|
+
const nOpenApiRequestTimeoutMs = 30_000
|
|
29
|
+
|
|
30
|
+
const fnAssertHttpUrl = (strUrl, strLabel) => {
|
|
31
|
+
if (!/^https?:\/\//i.test(strUrl)) {
|
|
32
|
+
throw new Error(`${strLabel} must be an absolute HTTP(S) URL: ${strUrl}`)
|
|
33
|
+
}
|
|
34
|
+
return strUrl
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const fnJoinUrl = (strBaseUrl, strDocumentPath) => {
|
|
38
|
+
if (!strBaseUrl) return undefined
|
|
39
|
+
fnAssertHttpUrl(strBaseUrl, 'API base URL')
|
|
40
|
+
return `${strBaseUrl.replace(/\/$/, '')}/${strDocumentPath.replace(/^\//, '')}`
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const fnToIdentifier = (strValue) => {
|
|
44
|
+
const arrParts = String(strValue || '')
|
|
45
|
+
.split(/[^A-Za-z0-9_$]+/)
|
|
46
|
+
.filter(Boolean)
|
|
47
|
+
const strIdentifier = arrParts
|
|
48
|
+
.map((strPart, nIndex) =>
|
|
49
|
+
nIndex === 0 ? strPart : strPart[0].toUpperCase() + strPart.slice(1)
|
|
50
|
+
)
|
|
51
|
+
.join('')
|
|
52
|
+
|
|
53
|
+
if (!strIdentifier) return 'request'
|
|
54
|
+
return /^[A-Za-z_$]/.test(strIdentifier)
|
|
55
|
+
? strIdentifier
|
|
56
|
+
: `request${strIdentifier}`
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const fnReadServiceDefinitions = async () => {
|
|
60
|
+
let arrDefinitions
|
|
61
|
+
try {
|
|
62
|
+
arrDefinitions = JSON.parse(await readFile(strServiceConfigPath, 'utf8'))
|
|
63
|
+
} catch {
|
|
64
|
+
throw new Error(
|
|
65
|
+
`Unable to read API service config: ${strServiceConfigPath}`
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
if (!Array.isArray(arrDefinitions) || arrDefinitions.length === 0) {
|
|
69
|
+
throw new Error('API service config must be a non-empty JSON array.')
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const objServiceNames = new Set()
|
|
73
|
+
return arrDefinitions.map((objDefinition, nIndex) => {
|
|
74
|
+
if (
|
|
75
|
+
!objDefinition ||
|
|
76
|
+
typeof objDefinition !== 'object' ||
|
|
77
|
+
Array.isArray(objDefinition)
|
|
78
|
+
) {
|
|
79
|
+
throw new Error(`Invalid API service definition at index ${nIndex}.`)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const {
|
|
83
|
+
name: strName,
|
|
84
|
+
baseUrlEnv: strBaseUrlEnv = 'VITE_API_BASE_URL',
|
|
85
|
+
openapiPath: strOpenApiPath,
|
|
86
|
+
} = objDefinition
|
|
87
|
+
if (!objServiceNamePattern.test(strName)) {
|
|
88
|
+
throw new Error(`Invalid API service name: ${strName}`)
|
|
89
|
+
}
|
|
90
|
+
if (objServiceNames.has(strName)) {
|
|
91
|
+
throw new Error(`Duplicate API service name: ${strName}`)
|
|
92
|
+
}
|
|
93
|
+
if (!objEnvNamePattern.test(strBaseUrlEnv)) {
|
|
94
|
+
throw new Error(`Invalid baseUrlEnv for API service "${strName}".`)
|
|
95
|
+
}
|
|
96
|
+
if (typeof strOpenApiPath !== 'string' || !strOpenApiPath.startsWith('/')) {
|
|
97
|
+
throw new Error(
|
|
98
|
+
`API service "${strName}" requires an absolute openapiPath.`
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
objServiceNames.add(strName)
|
|
103
|
+
return {
|
|
104
|
+
name: strName,
|
|
105
|
+
baseUrlEnv: strBaseUrlEnv,
|
|
106
|
+
openapiPath: strOpenApiPath,
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const arrServiceDefinitions = await fnReadServiceDefinitions()
|
|
112
|
+
const bApiInsecureTls =
|
|
113
|
+
strMode === 'development' &&
|
|
114
|
+
objEnv.VITE_DEV_API_INSECURE_TLS?.trim().toLowerCase() === 'true'
|
|
115
|
+
if (strRequestedName && !objServiceNamePattern.test(strRequestedName)) {
|
|
116
|
+
throw new Error(`Invalid API service name: ${strRequestedName}`)
|
|
117
|
+
}
|
|
118
|
+
if (strExplicitUrl && !strRequestedName) {
|
|
119
|
+
throw new Error('--url must be used together with --name.')
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const arrSelectedDefinitions = strRequestedName
|
|
123
|
+
? arrServiceDefinitions.filter(
|
|
124
|
+
(objDefinition) => objDefinition.name === strRequestedName
|
|
125
|
+
)
|
|
126
|
+
: arrServiceDefinitions
|
|
127
|
+
if (arrSelectedDefinitions.length === 0) {
|
|
128
|
+
throw new Error(`API service is not configured: ${strRequestedName}`)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const arrTargets = arrSelectedDefinitions.map((objDefinition) => {
|
|
132
|
+
const strBaseUrl = objEnv[objDefinition.baseUrlEnv]?.trim()
|
|
133
|
+
const strSchemaUrl = strExplicitUrl
|
|
134
|
+
? fnAssertHttpUrl(strExplicitUrl, 'OpenAPI schema URL')
|
|
135
|
+
: fnJoinUrl(strBaseUrl, objDefinition.openapiPath)
|
|
136
|
+
if (!strSchemaUrl) {
|
|
137
|
+
throw new Error(
|
|
138
|
+
`${objDefinition.baseUrlEnv} is required for API service "${objDefinition.name}" in mode "${strMode}".`
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
return { ...objDefinition, schemaUrl: strSchemaUrl }
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
const fnReadOpenApiSpec = async (strSchemaUrl) => {
|
|
145
|
+
const objHttpsAgent =
|
|
146
|
+
bApiInsecureTls && strSchemaUrl.startsWith('https://')
|
|
147
|
+
? new https.Agent({ rejectUnauthorized: false })
|
|
148
|
+
: undefined
|
|
149
|
+
try {
|
|
150
|
+
process.stdout.write(
|
|
151
|
+
`Downloading ${strSchemaUrl}${objHttpsAgent ? ' with development TLS verification disabled' : ''}.\n`
|
|
152
|
+
)
|
|
153
|
+
const objResponse = await axios.get(strSchemaUrl, {
|
|
154
|
+
httpsAgent: objHttpsAgent,
|
|
155
|
+
timeout: nOpenApiRequestTimeoutMs,
|
|
156
|
+
})
|
|
157
|
+
return objResponse.data
|
|
158
|
+
} finally {
|
|
159
|
+
objHttpsAgent?.destroy()
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const objCommonOptions = {
|
|
164
|
+
templates: path.resolve(strCurrentDir, 'templates/default'),
|
|
165
|
+
httpClientType: 'axios',
|
|
166
|
+
defaultResponseAsSuccess: false,
|
|
167
|
+
generateRouteTypes: false,
|
|
168
|
+
generateResponses: false,
|
|
169
|
+
toJS: false,
|
|
170
|
+
extractRequestParams: false,
|
|
171
|
+
extractRequestBody: false,
|
|
172
|
+
unwrapResponseData: true,
|
|
173
|
+
prettier: {
|
|
174
|
+
printWidth: 120,
|
|
175
|
+
tabWidth: 2,
|
|
176
|
+
trailingComma: 'all',
|
|
177
|
+
parser: 'typescript',
|
|
178
|
+
},
|
|
179
|
+
hooks: {
|
|
180
|
+
onFormatRouteName: (objRouteInfo) => {
|
|
181
|
+
if (objRouteInfo.operationId) {
|
|
182
|
+
return fnToIdentifier(objRouteInfo.operationId)
|
|
183
|
+
}
|
|
184
|
+
if (!objRouteInfo.route) return 'request'
|
|
185
|
+
const strRouteName = `${objRouteInfo.route}/${objRouteInfo.method}`
|
|
186
|
+
.split('/')
|
|
187
|
+
.filter(Boolean)
|
|
188
|
+
.map((strPart, nIndex) => {
|
|
189
|
+
const strNormalized = strPart.replace(/\$|{|}|-/g, '')
|
|
190
|
+
return nIndex === 0
|
|
191
|
+
? strNormalized
|
|
192
|
+
: strNormalized[0].toUpperCase() + strNormalized.slice(1)
|
|
193
|
+
})
|
|
194
|
+
.join('')
|
|
195
|
+
return fnToIdentifier(strRouteName)
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
defaultResponseType: 'void',
|
|
199
|
+
singleHttpClient: false,
|
|
200
|
+
cleanOutput: true,
|
|
201
|
+
enumNamesAsValues: false,
|
|
202
|
+
generateUnionEnums: false,
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const fnReplaceDirectory = async (strPreparedPath, strDestinationPath) => {
|
|
206
|
+
const strBackupPath = `${strDestinationPath}.backup-${process.pid}`
|
|
207
|
+
let bHasBackup = false
|
|
208
|
+
|
|
209
|
+
try {
|
|
210
|
+
await rename(strDestinationPath, strBackupPath)
|
|
211
|
+
bHasBackup = true
|
|
212
|
+
} catch (objError) {
|
|
213
|
+
if (objError?.code !== 'ENOENT') throw objError
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
try {
|
|
217
|
+
await rename(strPreparedPath, strDestinationPath)
|
|
218
|
+
} catch (objError) {
|
|
219
|
+
if (bHasBackup) await rename(strBackupPath, strDestinationPath)
|
|
220
|
+
throw objError
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (bHasBackup) {
|
|
224
|
+
await rm(strBackupPath, { recursive: true, force: true })
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const arrPreparedTargets = await Promise.all(
|
|
229
|
+
arrTargets.map(async (objTarget) => ({
|
|
230
|
+
...objTarget,
|
|
231
|
+
spec: await fnReadOpenApiSpec(objTarget.schemaUrl),
|
|
232
|
+
}))
|
|
233
|
+
)
|
|
234
|
+
const strOutputParent = path.dirname(strOutputRoot)
|
|
235
|
+
await mkdir(strOutputParent, { recursive: true })
|
|
236
|
+
const strTemporaryRoot = await mkdtemp(
|
|
237
|
+
path.resolve(strOutputParent, '.generated-')
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
try {
|
|
241
|
+
for (const objTarget of arrPreparedTargets) {
|
|
242
|
+
const strOutput = path.resolve(strTemporaryRoot, objTarget.name)
|
|
243
|
+
await generateApi({
|
|
244
|
+
...objCommonOptions,
|
|
245
|
+
fileName: 'Api.ts',
|
|
246
|
+
spec: objTarget.spec,
|
|
247
|
+
output: strOutput,
|
|
248
|
+
moduleNameFirstTag: false,
|
|
249
|
+
})
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (strRequestedName) {
|
|
253
|
+
await fnReplaceDirectory(
|
|
254
|
+
path.resolve(strTemporaryRoot, strRequestedName),
|
|
255
|
+
path.resolve(strOutputRoot, strRequestedName)
|
|
256
|
+
)
|
|
257
|
+
} else {
|
|
258
|
+
await fnReplaceDirectory(strTemporaryRoot, strOutputRoot)
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
for (const objTarget of arrPreparedTargets) {
|
|
262
|
+
process.stdout.write(
|
|
263
|
+
`Generated ${objTarget.name} API client in ${path.resolve(strOutputRoot, objTarget.name)}\n`
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
} finally {
|
|
267
|
+
await rm(strTemporaryRoot, { recursive: true, force: true })
|
|
268
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# swagger-typescript-api
|
|
2
|
+
|
|
3
|
+
# templates
|
|
4
|
+
|
|
5
|
+
Templates:
|
|
6
|
+
|
|
7
|
+
- `api.eta` - Api class module (locations: [default](https://github.com/acacode/swagger-typescript-api/tree/next/templates/default/api.eta), [modular](https://github.com/acacode/swagger-typescript-api/tree/next/templates/modular/api.eta))
|
|
8
|
+
- `data-contracts.eta` - all types (data contracts) from swagger schema (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/data-contracts.eta))
|
|
9
|
+
- `http-client.eta` - HttpClient class module (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/http-client.eta))
|
|
10
|
+
- `procedure-call.eta` - route in Api class (locations: [default](https://github.com/acacode/swagger-typescript-api/tree/next/templates/default/procedure-call.eta), [modular](https://github.com/acacode/swagger-typescript-api/tree/next/templates/modular/procedure-call.eta))
|
|
11
|
+
- `route-docs.eta` - documentation for route in Api class (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/route-docs.eta))
|
|
12
|
+
- `route-name.eta` - route name for route in Api class (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/route-name.eta))
|
|
13
|
+
- `route-type.eta` - _(`--route-types` option)_ (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/route-type.eta))
|
|
14
|
+
- `route-types.eta` - _(`--route-types` option)_ (locations: [base](https://github.com/acacode/swagger-typescript-api/tree/next/templates/base/route-types.eta))
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<%
|
|
2
|
+
const { modelTypes, utils } = it;
|
|
3
|
+
const { formatDescription, require, _ } = utils;
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const dataContractTemplates = {
|
|
7
|
+
enum: (contract) => {
|
|
8
|
+
return `enum ${contract.name} {\r\n${contract.content} \r\n }`;
|
|
9
|
+
},
|
|
10
|
+
interface: (contract) => {
|
|
11
|
+
return `interface ${contract.name} {\r\n${contract.content}}`;
|
|
12
|
+
},
|
|
13
|
+
type: (contract) => {
|
|
14
|
+
return `type ${contract.name} = ${contract.content}`;
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const createDescription = (contract) => {
|
|
19
|
+
if (!contract.typeData) return _.compact([contract.description]);
|
|
20
|
+
|
|
21
|
+
return _.compact([
|
|
22
|
+
contract.description && formatDescription(contract.description),
|
|
23
|
+
!_.isUndefined(contract.typeData.format) && `@format ${contract.typeData.format}`,
|
|
24
|
+
!_.isUndefined(contract.typeData.minimum) && `@min ${contract.typeData.minimum}`,
|
|
25
|
+
!_.isUndefined(contract.typeData.maximum) && `@max ${contract.typeData.maximum}`,
|
|
26
|
+
!_.isUndefined(contract.typeData.pattern) && `@pattern ${contract.typeData.pattern}`,
|
|
27
|
+
!_.isUndefined(contract.typeData.example) && `@example ${
|
|
28
|
+
_.isObject(contract.typeData.example) ? JSON.stringify(contract.typeData.example) : contract.typeData.example
|
|
29
|
+
}`,
|
|
30
|
+
]);
|
|
31
|
+
}
|
|
32
|
+
%>
|
|
33
|
+
<% modelTypes.forEach((contract) => { %>
|
|
34
|
+
<% const description = createDescription(contract); %>
|
|
35
|
+
<% if (description.length) { %>
|
|
36
|
+
/**
|
|
37
|
+
<%~ description.map(part => `* ${part}`).join("\n") %>
|
|
38
|
+
|
|
39
|
+
*/
|
|
40
|
+
<% } %>
|
|
41
|
+
export <%~ (dataContractTemplates[contract.typeIdentifier] || dataContractTemplates.type)(contract) %>
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
<% }) %>
|