@processfocus/runtime-local 0.1.0-next.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/LICENSE.md +28 -0
- package/README.md +290 -0
- package/dist/authentication-server.mjs +188 -0
- package/dist/chunk-2sb4v2sx.js +70 -0
- package/dist/chunk-9weqs8n8.js +56031 -0
- package/dist/chunk-mvkr77wp.js +54113 -0
- package/dist/chunk-tkn4cnc8.js +453 -0
- package/dist/chunk-vpsm84e8.js +85 -0
- package/dist/dashboard-source/apps/frontend/app/%5Fpf/app-icons/[...path]/route.ts +63 -0
- package/dist/dashboard-source/apps/frontend/app/%5Fpf/health/page.tsx +19 -0
- package/dist/dashboard-source/apps/frontend/app/%5Fpf/public-form-branding/[...path]/route.ts +95 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/actions.ts +248 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/delegations-client.tsx +751 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/page.tsx +46 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/client-index.tsx +375 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/client.tsx +14 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/client.tsx +73 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/page.tsx +20 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/process-state/page.tsx +22 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/[executionId]/page.tsx +11 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/[executionId]/process-state/page.tsx +23 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/abandon-execution-dialog.tsx +137 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/execution-card-menu.tsx +233 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/layout.tsx +19 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/page.tsx +1549 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-dialog.tsx +91 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-modal-client.tsx +33 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-page-client.tsx +31 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-route-fallback.tsx +18 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/restart-execution-feedback.tsx +40 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/layout.tsx +129 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/(.)item/[id]/client.tsx +215 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/(.)item/[id]/page.tsx +23 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/[...listPath]/list-page-client.tsx +678 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/[...listPath]/loading.tsx +10 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/[...listPath]/page.tsx +228 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-create-form.tsx +147 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-item-edit-form.tsx +246 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/metric-control-url-state.ts +71 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/use-list-deleted-callback.ts +22 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/use-list-item-detail.ts +315 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/item/[id]/client.tsx +259 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/item/[id]/page.tsx +46 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/layout.tsx +14 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/lib/list-detail-title.ts +20 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/lib/list-refresh.ts +26 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/utils.ts +20 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/loading.tsx +5 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/org-chart/org-chart-client.tsx +74 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/org-chart/page.tsx +120 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/page.tsx +13 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/actions.ts +188 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/page.tsx +33 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/passkeys-client.tsx +320 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/(.)start/[...startStepPath]/client.tsx +152 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/(.)start/[...startStepPath]/page.tsx +41 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/client.tsx +33 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/process-form-actions.tsx +105 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/process-submit-button.tsx +81 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/start-process-form.tsx +282 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/layout.tsx +21 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/lib/mobile-process-catalog.ts +28 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/lib/start-process-actions.ts +13 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/loading.tsx +10 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/page.tsx +5 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/processes-client.tsx +504 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/start/[...startStepPath]/client.tsx +153 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/start/[...startStepPath]/page.tsx +39 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/loading.tsx +20 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/page.tsx +131 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/process-documentation.tsx +209 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/use-workflow-auto-refresh.ts +120 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/workflow-flow.tsx +319 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/workflow-form-preview-sheet.tsx +98 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/[[...tab]]/loading.tsx +1 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/[[...tab]]/page.tsx +100 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/access-handbook.tsx +110 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/authorization-loading.tsx +25 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/authorization-tabs.tsx +47 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-authorize.ts +261 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-helpers.ts +17 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-source.tsx +34 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-types.ts +79 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/evaluate-cedar.ts +43 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/explorer.tsx +526 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/layout.tsx +23 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/load-cedar.ts +174 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/load-handbook.ts +390 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/org-data.ts +70 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/[invitationId]/page.tsx +22 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/invitation-detail-client.tsx +594 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/invitation-detail-skeleton.tsx +48 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/new/page.tsx +5 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations-table.tsx +186 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/page.tsx +69 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/providers-table.tsx +48 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/roles-table.tsx +62 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/settings-client.tsx +244 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/client.tsx +329 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/page.tsx +21 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/tokens/page.tsx +39 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users-table.tsx +82 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/error.tsx +34 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/not-found.tsx +13 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/page.tsx +84 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/stats-data-fetcher.tsx +93 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/(.)complete/[...stepPath]/client.tsx +143 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/(.)complete/[...stepPath]/page.tsx +50 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/complete/[...stepPath]/client.tsx +131 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/complete/[...stepPath]/page.tsx +50 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/complete-todo-form.tsx +172 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/public-completion-correction-form.tsx +233 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/todo-form-actions.tsx +26 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/correct/[...stepPath]/page.tsx +58 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/layout.tsx +14 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/lib/mobile-todo-list.ts +154 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/page.tsx +1317 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/callback/route.ts +259 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/delegation/route.ts +127 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/login/route.ts +49 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/logout/route.ts +33 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/auth-options/route.ts +79 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/auth-verify/route.ts +142 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/register/route.ts +103 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/register-verify/route.ts +136 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/registration-session/route.ts +129 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/start/route.ts +153 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/refresh/route.ts +122 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/switch-role/route.ts +177 -0
- package/dist/dashboard-source/apps/frontend/app/api/dev/import-completed/route.ts +22 -0
- package/dist/dashboard-source/apps/frontend/app/api/dev/import-events/route.ts +38 -0
- package/dist/dashboard-source/apps/frontend/app/api/embed/lookup/route.ts +266 -0
- package/dist/dashboard-source/apps/frontend/app/api/embed/submit/route.ts +118 -0
- package/dist/dashboard-source/apps/frontend/app/api/embed/test-host/route.ts +125 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/calendar-slots/route.ts +44 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/complete/route.ts +56 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/lookup/route.ts +61 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/request-fresh-link/route.ts +41 -0
- package/dist/dashboard-source/apps/frontend/app/api/revalidate/route.ts +61 -0
- package/dist/dashboard-source/apps/frontend/app/app-shell.tsx +100 -0
- package/dist/dashboard-source/apps/frontend/app/cli-auth/route.ts +261 -0
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/embed-client.tsx +393 -0
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/loading.tsx +13 -0
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/page.tsx +51 -0
- package/dist/dashboard-source/apps/frontend/app/embed/embedded.css +48 -0
- package/dist/dashboard-source/apps/frontend/app/embed/layout.tsx +15 -0
- package/dist/dashboard-source/apps/frontend/app/global.css +13 -0
- package/dist/dashboard-source/apps/frontend/app/layout.tsx +102 -0
- package/dist/dashboard-source/apps/frontend/app/login/layout.tsx +9 -0
- package/dist/dashboard-source/apps/frontend/app/login/login-button.tsx +35 -0
- package/dist/dashboard-source/apps/frontend/app/login/login-form-content.tsx +117 -0
- package/dist/dashboard-source/apps/frontend/app/login/login-form.tsx +30 -0
- package/dist/dashboard-source/apps/frontend/app/login/page.tsx +52 -0
- package/dist/dashboard-source/apps/frontend/app/login/passkey-button.tsx +226 -0
- package/dist/dashboard-source/apps/frontend/app/login/secret-login-form.tsx +91 -0
- package/dist/dashboard-source/apps/frontend/app/manifest.ts +7 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/error.tsx +63 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/layout.tsx +34 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/page.tsx +129 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-form-branding-card.tsx +42 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-form-branding-context.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-form-branding-html.tsx +40 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-todo-client.tsx +553 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-todo-state-content.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/app/public.css +33 -0
- package/dist/dashboard-source/apps/frontend/app/register/passkey/layout.tsx +49 -0
- package/dist/dashboard-source/apps/frontend/app/register/passkey/page.tsx +36 -0
- package/dist/dashboard-source/apps/frontend/app/register/passkey/register-passkey-client.tsx +292 -0
- package/dist/dashboard-source/apps/frontend/app/theme.css +117 -0
- package/dist/dashboard-source/apps/frontend/components/DashboardSection.tsx +693 -0
- package/dist/dashboard-source/apps/frontend/components/Header.tsx +481 -0
- package/dist/dashboard-source/apps/frontend/components/OrgUnitNode.tsx +41 -0
- package/dist/dashboard-source/apps/frontend/components/app-sidebar.tsx +245 -0
- package/dist/dashboard-source/apps/frontend/components/auth-provider.tsx +158 -0
- package/dist/dashboard-source/apps/frontend/components/collections/collection-table-card.tsx +218 -0
- package/dist/dashboard-source/apps/frontend/components/collections/collection-table-header-row.tsx +97 -0
- package/dist/dashboard-source/apps/frontend/components/config-provider.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/components/copy-button.tsx +40 -0
- package/dist/dashboard-source/apps/frontend/components/dashboard-activity.tsx +35 -0
- package/dist/dashboard-source/apps/frontend/components/dashboard-skeleton.tsx +17 -0
- package/dist/dashboard-source/apps/frontend/components/delegation-expiry.tsx +21 -0
- package/dist/dashboard-source/apps/frontend/components/feature-permissions-provider.tsx +28 -0
- package/dist/dashboard-source/apps/frontend/components/form-dialog-content.tsx +66 -0
- package/dist/dashboard-source/apps/frontend/components/frontend-client-plugin-host.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/components/frontend-client-plugin-identify.tsx +33 -0
- package/dist/dashboard-source/apps/frontend/components/frontend-client-plugin-provider.tsx +55 -0
- package/dist/dashboard-source/apps/frontend/components/journey-timeline.tsx +378 -0
- package/dist/dashboard-source/apps/frontend/components/mobile-home-switchboard.tsx +98 -0
- package/dist/dashboard-source/apps/frontend/components/mocks-provider.tsx +27 -0
- package/dist/dashboard-source/apps/frontend/components/notification-bell.tsx +137 -0
- package/dist/dashboard-source/apps/frontend/components/org-settings-provider.tsx +26 -0
- package/dist/dashboard-source/apps/frontend/components/process-workflow-link.tsx +36 -0
- package/dist/dashboard-source/apps/frontend/components/session-reissue.tsx +48 -0
- package/dist/dashboard-source/apps/frontend/components/sidebar-lists.tsx +89 -0
- package/dist/dashboard-source/apps/frontend/components/sidebar-stats-views.tsx +65 -0
- package/dist/dashboard-source/apps/frontend/components/theme-provider.tsx +132 -0
- package/dist/dashboard-source/apps/frontend/components/todo-count-badge.tsx +59 -0
- package/dist/dashboard-source/apps/frontend/components/token-refresh-scheduler.tsx +304 -0
- package/dist/dashboard-source/apps/frontend/components/ui/checkbox.tsx +31 -0
- package/dist/dashboard-source/apps/frontend/components/ui/dialog.tsx +142 -0
- package/dist/dashboard-source/apps/frontend/components/ui/dropdown-menu.tsx +256 -0
- package/dist/dashboard-source/apps/frontend/components/ui/input.tsx +20 -0
- package/dist/dashboard-source/apps/frontend/components/ui/pagination.tsx +59 -0
- package/dist/dashboard-source/apps/frontend/components/ui/sheet.tsx +138 -0
- package/dist/dashboard-source/apps/frontend/components/ui/sidebar.tsx +741 -0
- package/dist/dashboard-source/apps/frontend/components/ui/skeleton.tsx +13 -0
- package/dist/dashboard-source/apps/frontend/components/ui/tab-pill.tsx +30 -0
- package/dist/dashboard-source/apps/frontend/components/ui/table.tsx +115 -0
- package/dist/dashboard-source/apps/frontend/components/ui/tooltip.tsx +60 -0
- package/dist/dashboard-source/apps/frontend/components/without-waiting-badge.tsx +24 -0
- package/dist/dashboard-source/apps/frontend/components/workflow/step-node.tsx +116 -0
- package/dist/dashboard-source/apps/frontend/components/workflow/swimlane-node.tsx +46 -0
- package/dist/dashboard-source/apps/frontend/components/workflow/workflow-edge.tsx +172 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-draft-process-save.ts +189 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-draft-state.ts +79 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-form-metadata.ts +74 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-mobile.ts +27 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-notification-preference.ts +246 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-processes-query.ts +56 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-weekly-execution-stats.ts +101 -0
- package/dist/dashboard-source/apps/frontend/index.d.ts +12 -0
- package/dist/dashboard-source/apps/frontend/instrumentation.node.ts +25 -0
- package/dist/dashboard-source/apps/frontend/instrumentation.ts +19 -0
- package/dist/dashboard-source/apps/frontend/lib/app-icons-metadata.ts +66 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/adapter.ts +128 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/client.ts +355 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/config.ts +18 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/reconnect-registry.ts +34 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/act-on-behalf-menu.ts +9 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/callback-error.ts +26 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/client-session.ts +32 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/client.ts +46 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/config.ts +48 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/delegations.ts +62 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/issuer.ts +164 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/jwt.ts +17 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/logout.ts +35 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/passkeys-menu.ts +9 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/passkeys.ts +117 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/providers.ts +52 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/realtime-session-token.ts +62 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/reauthentication-state.ts +16 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/redirect.ts +105 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/secret-login-presentation.ts +33 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/session-cache-scope.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/session-role.ts +6 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/session.ts +277 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/ssr-session.ts +76 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/verify-passkey.ts +95 -0
- package/dist/dashboard-source/apps/frontend/lib/authorization-tabs.ts +19 -0
- package/dist/dashboard-source/apps/frontend/lib/cedar-highlight.ts +116 -0
- package/dist/dashboard-source/apps/frontend/lib/client-plugin-error-reporting.ts +28 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/collection-provider-factory.tsx +1119 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/collection-provider-scope.ts +48 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/database-error-ui.tsx +61 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/draft-process-execution-collection-provider.tsx +32 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/draft-process-execution.ts +161 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/execution-collection-provider.tsx +42 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/execution.ts +215 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/graphql-stream.ts +123 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/process-collection-provider.tsx +30 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/process.ts +123 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/replication-factory.ts +394 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/replication-registry.ts +196 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/rxdb-database-name.ts +19 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/rxdb-lifecycle.ts +368 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/rxdb-provider.tsx +577 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/todo-collection-provider.tsx +30 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/todo.ts +133 -0
- package/dist/dashboard-source/apps/frontend/lib/current-provider-user.ts +30 -0
- package/dist/dashboard-source/apps/frontend/lib/dev/frontend-port-file.ts +41 -0
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-events.ts +21 -0
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-query-invalidation.tsx +62 -0
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-refresh.ts +40 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/error-boundary.tsx +84 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/index.ts +31 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/params.ts +57 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/run-effect.ts +17 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/runtime.ts +168 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/access-token.ts +48 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/authorization.ts +206 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/form-validation.ts +36 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/graphql.ts +94 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/services/index.ts +21 -0
- package/dist/dashboard-source/apps/frontend/lib/embed-manifest-store.ts +20 -0
- package/dist/dashboard-source/apps/frontend/lib/embed-manifest.ts +152 -0
- package/dist/dashboard-source/apps/frontend/lib/embed-request-origin.ts +39 -0
- package/dist/dashboard-source/apps/frontend/lib/errors/get-display-error-message.ts +22 -0
- package/dist/dashboard-source/apps/frontend/lib/execution-menu-actions-registry.ts +26 -0
- package/dist/dashboard-source/apps/frontend/lib/feature-permissions.ts +13 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-boot-health.tsx +161 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-client-plugin-registry.ts +45 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-manifest-store.ts +214 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-manifest.ts +74 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-plugin-loaders.ts +191 -0
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/fragment-masking.ts +87 -0
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/gql.ts +292 -0
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/graphql.ts +443 -0
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/index.ts +2 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/client-consumer.tsx +23 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/client-error-reporting.ts +268 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/client-provider.tsx +59 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/dashboard-activity.ts +7 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/dependent-lookup-query.ts +78 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/endpoint.ts +26 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/execution-queries.ts +70 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/file-upload-provider.tsx +82 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/graphql-identifiers.ts +10 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/list-queries.ts +327 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/lookup-provider.tsx +81 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/org-chart-operations.ts +63 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/org-chart-queries.ts +67 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/provider-user-queries.ts +65 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/queries.ts +80 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/server-client.ts +15 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/settings-queries.ts +634 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/stats-views-server.ts +16 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/stats-views.ts +33 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/user-queries.ts +138 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/workflow-operations.ts +54 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/workflow-queries.ts +50 -0
- package/dist/dashboard-source/apps/frontend/lib/mobile-home-view-model.ts +74 -0
- package/dist/dashboard-source/apps/frontend/lib/mobile-shell-policy.ts +124 -0
- package/dist/dashboard-source/apps/frontend/lib/mock-data.ts +364 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/notification-preference.ts +251 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/todo-notification-observer.ts +178 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/todo-notifications-runtime.tsx +14 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/use-todo-notifications.tsx +103 -0
- package/dist/dashboard-source/apps/frontend/lib/org-chart-data.ts +50 -0
- package/dist/dashboard-source/apps/frontend/lib/org-chart-depth-config.ts +71 -0
- package/dist/dashboard-source/apps/frontend/lib/org-chart-layout.ts +149 -0
- package/dist/dashboard-source/apps/frontend/lib/org-chart-types.ts +17 -0
- package/dist/dashboard-source/apps/frontend/lib/org-identity.ts +57 -0
- package/dist/dashboard-source/apps/frontend/lib/organisation-plugin-loaders.ts +13 -0
- package/dist/dashboard-source/apps/frontend/lib/organisation-plugin-preparation.ts +2 -0
- package/dist/dashboard-source/apps/frontend/lib/plugins-client.tsx +99 -0
- package/dist/dashboard-source/apps/frontend/lib/plugins.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-form-runtime.ts +9 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-graphql-errors.ts +45 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-model.ts +200 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-server.ts +209 -0
- package/dist/dashboard-source/apps/frontend/lib/query-client.ts +41 -0
- package/dist/dashboard-source/apps/frontend/lib/restart-execution-action.ts +76 -0
- package/dist/dashboard-source/apps/frontend/lib/runtime-config.ts +23 -0
- package/dist/dashboard-source/apps/frontend/lib/telemetry/constants.ts +5 -0
- package/dist/dashboard-source/apps/frontend/lib/telemetry/otlp-config.ts +16 -0
- package/dist/dashboard-source/apps/frontend/lib/telemetry/register-otel.ts +308 -0
- package/dist/dashboard-source/apps/frontend/lib/theme.ts +9 -0
- package/dist/dashboard-source/apps/frontend/lib/todo-types.ts +64 -0
- package/dist/dashboard-source/apps/frontend/lib/todo-utils.ts +144 -0
- package/dist/dashboard-source/apps/frontend/lib/types/org-identity.ts +7 -0
- package/dist/dashboard-source/apps/frontend/lib/utils.ts +16 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/constants.ts +118 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/edge-routing.ts +195 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/form-preview.ts +8 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/layout.ts +878 -0
- package/dist/dashboard-source/apps/frontend/lib/workflow/types.ts +63 -0
- package/dist/dashboard-source/apps/frontend/next.config.ts +238 -0
- package/dist/dashboard-source/apps/frontend/package.json +71 -0
- package/dist/dashboard-source/apps/frontend/postcss.config.mjs +5 -0
- package/dist/dashboard-source/apps/frontend/proxy.ts +293 -0
- package/dist/dashboard-source/apps/frontend/public/.gitkeep +0 -0
- package/dist/dashboard-source/apps/frontend/public/favicon.ico +0 -0
- package/dist/dashboard-source/apps/frontend/public/processfocus-embed.js +553 -0
- package/dist/dashboard-source/apps/frontend/tsconfig.json +35 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/index.ts +7 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/auth-local-cedar.ts +1397 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/cedar-reload-notifier.ts +18 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/config-base.ts +346 -0
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/policy-watcher.ts +172 -0
- package/dist/dashboard-source/modules/auth-policy/src/index.ts +4 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/auth-policy.ts +263 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/current-principal.ts +34 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/errors.ts +47 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/types.ts +595 -0
- package/dist/dashboard-source/modules/auth-session/src/index.ts +22 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/issuer-url.ts +192 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/realtime-recipient.ts +76 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/session-cache-scope.ts +24 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/subjects.ts +54 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/url.ts +2 -0
- package/dist/dashboard-source/modules/aws-common/src/index.ts +3 -0
- package/dist/dashboard-source/modules/aws-common/src/lib/acm.ts +50 -0
- package/dist/dashboard-source/modules/aws-common/src/lib/otlp-config.ts +66 -0
- package/dist/dashboard-source/modules/aws-common/src/lib/runtime-ssm.ts +28 -0
- package/dist/dashboard-source/modules/effect-json-logger/src/index.ts +1 -0
- package/dist/dashboard-source/modules/effect-json-logger/src/lib/effect-json-logger.ts +65 -0
- package/dist/dashboard-source/modules/form/src/hooks/use-local-storage.ts +78 -0
- package/dist/dashboard-source/modules/form/src/index.ts +20 -0
- package/dist/dashboard-source/modules/form/src/lib/ajv-standard-schema.ts +152 -0
- package/dist/dashboard-source/modules/form/src/lib/client-components-to-form.tsx +1421 -0
- package/dist/dashboard-source/modules/form/src/lib/friendly-validation-message.ts +85 -0
- package/dist/dashboard-source/modules/form/src/lib/lookup-context.tsx +58 -0
- package/dist/dashboard-source/modules/form/src/lib/plugin-registry.ts +34 -0
- package/dist/dashboard-source/modules/form/src/lib/walker.tsx +1554 -0
- package/dist/dashboard-source/modules/form-client-representation/src/lib/client-form-definition.ts +440 -0
- package/dist/dashboard-source/modules/form-client-representation/src/lib/plugin-registry.ts +13 -0
- package/dist/dashboard-source/modules/form-client-representation/src/lib/types.ts +336 -0
- package/dist/dashboard-source/modules/form-rule/src/index.ts +21 -0
- package/dist/dashboard-source/modules/form-rule/src/lib/evaluator.ts +531 -0
- package/dist/dashboard-source/modules/form-rule/src/lib/paths.ts +102 -0
- package/dist/dashboard-source/modules/form-rule/src/lib/types.ts +121 -0
- package/dist/dashboard-source/modules/form-schema/src/index.ts +8 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/annotation-helpers.ts +44 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/deferred-value.ts +21 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/email.ts +50 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/field-count.ts +82 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/form-annotations.ts +58 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/form-schema.ts +975 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/phone.ts +60 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/property-signature.ts +45 -0
- package/dist/dashboard-source/modules/frontend-endpoints/src/endpoint.ts +137 -0
- package/dist/dashboard-source/modules/frontend-endpoints/src/index.ts +11 -0
- package/dist/dashboard-source/modules/frontend-endpoints/src/port-files.ts +219 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/index.ts +2 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/lib/browser-plugin-artifact.ts +201 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/lib/frontend-manifest.ts +408 -0
- package/dist/dashboard-source/modules/frontend-plugin-host/src/index.ts +29 -0
- package/dist/dashboard-source/modules/frontend-plugin-host/src/lib/frontend-plugin-host.ts +288 -0
- package/dist/dashboard-source/modules/openauth/src/client.ts +1045 -0
- package/dist/dashboard-source/modules/openauth/src/error.ts +140 -0
- package/dist/dashboard-source/modules/openauth/src/pkce.ts +40 -0
- package/dist/dashboard-source/modules/openauth/src/random.ts +24 -0
- package/dist/dashboard-source/modules/openauth/src/subject.ts +132 -0
- package/dist/dashboard-source/modules/openauth/src/util.ts +13 -0
- package/dist/dashboard-source/modules/request-time/src/index.ts +1 -0
- package/dist/dashboard-source/modules/request-time/src/lib/request-time.ts +30 -0
- package/dist/dashboard-source/modules/rxdb-collections/generated/draft-process-execution-schema.json +45 -0
- package/dist/dashboard-source/modules/rxdb-collections/generated/execution-schema.json +217 -0
- package/dist/dashboard-source/modules/rxdb-collections/generated/process-schema.json +77 -0
- package/dist/dashboard-source/modules/rxdb-collections/generated/todo-schema.json +94 -0
- package/dist/dashboard-source/modules/rxdb-collections/src/index.ts +2 -0
- package/dist/dashboard-source/modules/rxdb-collections/src/lib/rxdb-collections.ts +181 -0
- package/dist/dashboard-source/modules/rxdb-collections/src/lib/to-rxdb-schema.ts +166 -0
- package/dist/dashboard-source/modules/shadcn-components/src/index.ts +60 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/boolean-field.tsx +73 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/calendar-slot-field.tsx +808 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/date-field.tsx +127 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/field-set.tsx +14 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/file-field.tsx +321 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/file-upload-context.tsx +45 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/form-context.tsx +19 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/lookup-field.tsx +394 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/radio-field.tsx +96 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/select-field.tsx +106 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/text-field.tsx +245 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/button.tsx +63 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/checkbox.tsx +31 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/command.tsx +101 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/field.tsx +275 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/input.tsx +29 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/label.tsx +23 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/popover.tsx +31 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/separator.tsx +27 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/textarea.tsx +19 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/utils/utils.ts +4 -0
- package/dist/dashboard-source.json +70 -0
- package/dist/graphql-server.mjs +1319 -0
- package/dist/job-worker.mjs +989 -0
- package/dist/main.mjs +495 -0
- package/dist/prepare-dashboard.mjs +35 -0
- package/dist/resources/cedar/policies.cedar +315 -0
- package/dist/resources/cedar/schema.cedarschema +276 -0
- package/dist/resources/graphql-schema/rxdb.graphql +401 -0
- package/dist/resources/graphql-schema/system.graphql +1200 -0
- package/package.json +98 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import type { TaskPriority } from "../../../modules/rxdb-collections/src/index.ts"
|
|
2
|
+
import type { TaskStatus } from "./todo-types.ts"
|
|
3
|
+
|
|
4
|
+
type FormComplexity = "Simple" | "Medium" | "Complex"
|
|
5
|
+
|
|
6
|
+
export interface Task {
|
|
7
|
+
id: string
|
|
8
|
+
processName: string
|
|
9
|
+
stepName: string
|
|
10
|
+
role: string
|
|
11
|
+
status: TaskStatus
|
|
12
|
+
priority: TaskPriority
|
|
13
|
+
assignedDate: string
|
|
14
|
+
dueDate?: string
|
|
15
|
+
upcomingIn?: string
|
|
16
|
+
draftSavedAt?: string
|
|
17
|
+
overdueBy?: string
|
|
18
|
+
formComplexity: FormComplexity
|
|
19
|
+
description: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const tasks: Task[] = [
|
|
23
|
+
{
|
|
24
|
+
id: "task-1",
|
|
25
|
+
processName: "Employee Onboarding",
|
|
26
|
+
stepName: "Complete tax withholding form",
|
|
27
|
+
role: "Employee",
|
|
28
|
+
status: "Active",
|
|
29
|
+
priority: "High",
|
|
30
|
+
assignedDate: "Today",
|
|
31
|
+
dueDate: "Due in 4 hours",
|
|
32
|
+
formComplexity: "Medium",
|
|
33
|
+
description: "Provide payroll details for finance",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "task-2",
|
|
37
|
+
processName: "Purchase Request",
|
|
38
|
+
stepName: "Review purchase request #1234",
|
|
39
|
+
role: "Manager",
|
|
40
|
+
status: "Active",
|
|
41
|
+
priority: "Medium",
|
|
42
|
+
assignedDate: "Yesterday",
|
|
43
|
+
dueDate: "Due tomorrow",
|
|
44
|
+
formComplexity: "Simple",
|
|
45
|
+
description: "Approve purchase of monitors for design team",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "task-3",
|
|
49
|
+
processName: "Custom Project Kickoff",
|
|
50
|
+
stepName: "Provide project requirements",
|
|
51
|
+
role: "Product Owner",
|
|
52
|
+
status: "Draft",
|
|
53
|
+
priority: "Medium",
|
|
54
|
+
assignedDate: "Sep 18",
|
|
55
|
+
draftSavedAt: "Autosaved 2 minutes ago",
|
|
56
|
+
formComplexity: "Complex",
|
|
57
|
+
description: "Complete the discovery brief for project velocity",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "task-4",
|
|
61
|
+
processName: "Time Off Request",
|
|
62
|
+
stepName: "Acknowledge time off approval",
|
|
63
|
+
role: "Employee",
|
|
64
|
+
status: "Upcoming",
|
|
65
|
+
priority: "Low",
|
|
66
|
+
assignedDate: "Scheduled",
|
|
67
|
+
upcomingIn: "Expected in 2 days",
|
|
68
|
+
formComplexity: "Simple",
|
|
69
|
+
description: "Confirm receipt of approved time off",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "task-5",
|
|
73
|
+
processName: "Bug Report and Fix",
|
|
74
|
+
stepName: "Provide QA notes for bug #555",
|
|
75
|
+
role: "QA Analyst",
|
|
76
|
+
status: "Overdue",
|
|
77
|
+
priority: "High",
|
|
78
|
+
assignedDate: "Assigned 3 days ago",
|
|
79
|
+
overdueBy: "Overdue by 18 hours",
|
|
80
|
+
formComplexity: "Medium",
|
|
81
|
+
description: "Attach reproduction steps and verification checklist",
|
|
82
|
+
},
|
|
83
|
+
]
|
|
84
|
+
|
|
85
|
+
type ExecutionStatus = "Running" | "Paused" | "Completed" | "Failed"
|
|
86
|
+
|
|
87
|
+
interface ExecutionParticipant {
|
|
88
|
+
id: string
|
|
89
|
+
name: string
|
|
90
|
+
role: string
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface ExecutionStep {
|
|
94
|
+
id: string
|
|
95
|
+
name: string
|
|
96
|
+
status: "Complete" | "Current" | "Upcoming" | "Skipped"
|
|
97
|
+
role: string
|
|
98
|
+
startedAt?: string
|
|
99
|
+
completedAt?: string
|
|
100
|
+
assignee?: string
|
|
101
|
+
notes?: string
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface Execution {
|
|
105
|
+
id: string
|
|
106
|
+
processName: string
|
|
107
|
+
executionId: string
|
|
108
|
+
status: ExecutionStatus
|
|
109
|
+
progress: string
|
|
110
|
+
startDate: string
|
|
111
|
+
lastActivity: string
|
|
112
|
+
completionDate?: string
|
|
113
|
+
completionIso?: string
|
|
114
|
+
currentStep?: string
|
|
115
|
+
currentRole?: string
|
|
116
|
+
participants: ExecutionParticipant[]
|
|
117
|
+
steps: ExecutionStep[]
|
|
118
|
+
failureReason?: string
|
|
119
|
+
abandonedReason?: string
|
|
120
|
+
cycleTimeHours?: number
|
|
121
|
+
slaTargetHours?: number
|
|
122
|
+
slaBreached?: boolean
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const executions: Execution[] = [
|
|
126
|
+
{
|
|
127
|
+
id: "execution-4521",
|
|
128
|
+
processName: "Employee Onboarding",
|
|
129
|
+
executionId: "#4521",
|
|
130
|
+
status: "Running",
|
|
131
|
+
progress: "Step 2 of 4",
|
|
132
|
+
startDate: "Started 2 days ago",
|
|
133
|
+
lastActivity: "Updated 1 hour ago",
|
|
134
|
+
currentStep: "IT account setup",
|
|
135
|
+
currentRole: "IT Operations",
|
|
136
|
+
cycleTimeHours: 42,
|
|
137
|
+
slaTargetHours: 96,
|
|
138
|
+
slaBreached: false,
|
|
139
|
+
participants: [
|
|
140
|
+
{ id: "participant-1", name: "Anna Lee", role: "Employee" },
|
|
141
|
+
{ id: "participant-2", name: "Jordan Smith", role: "HR" },
|
|
142
|
+
{ id: "participant-3", name: "Miguel Perez", role: "IT Ops" },
|
|
143
|
+
],
|
|
144
|
+
steps: [
|
|
145
|
+
{
|
|
146
|
+
id: "step-1",
|
|
147
|
+
name: "Collect personal info",
|
|
148
|
+
status: "Complete",
|
|
149
|
+
role: "Employee",
|
|
150
|
+
startedAt: "Oct 8, 09:00",
|
|
151
|
+
completedAt: "Oct 8, 10:15",
|
|
152
|
+
assignee: "Anna Lee",
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: "step-2",
|
|
156
|
+
name: "IT account setup",
|
|
157
|
+
status: "Current",
|
|
158
|
+
role: "IT Operations",
|
|
159
|
+
startedAt: "Oct 8, 10:30",
|
|
160
|
+
assignee: "Miguel Perez",
|
|
161
|
+
notes: "Waiting for hardware confirmation",
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
id: "step-3",
|
|
165
|
+
name: "Benefits enrollment",
|
|
166
|
+
status: "Upcoming",
|
|
167
|
+
role: "Employee",
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
id: "step-4",
|
|
171
|
+
name: "Manager review",
|
|
172
|
+
status: "Upcoming",
|
|
173
|
+
role: "Manager",
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
id: "execution-1234",
|
|
179
|
+
processName: "Purchase Request",
|
|
180
|
+
executionId: "#1234",
|
|
181
|
+
status: "Running",
|
|
182
|
+
progress: "Step 3 of 4",
|
|
183
|
+
startDate: "Started 1 week ago",
|
|
184
|
+
lastActivity: "Updated 2 hours ago",
|
|
185
|
+
currentStep: "Finance approval",
|
|
186
|
+
currentRole: "Finance",
|
|
187
|
+
cycleTimeHours: 120,
|
|
188
|
+
slaTargetHours: 144,
|
|
189
|
+
slaBreached: false,
|
|
190
|
+
participants: [
|
|
191
|
+
{ id: "participant-4", name: "Noah Patel", role: "Requester" },
|
|
192
|
+
{ id: "participant-5", name: "Ava Brooks", role: "Manager" },
|
|
193
|
+
{ id: "participant-6", name: "Liam Chen", role: "Finance" },
|
|
194
|
+
],
|
|
195
|
+
steps: [
|
|
196
|
+
{
|
|
197
|
+
id: "step-a",
|
|
198
|
+
name: "Submit request",
|
|
199
|
+
status: "Complete",
|
|
200
|
+
role: "Requester",
|
|
201
|
+
startedAt: "Oct 1, 11:20",
|
|
202
|
+
completedAt: "Oct 1, 11:32",
|
|
203
|
+
assignee: "Noah Patel",
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
id: "step-b",
|
|
207
|
+
name: "Manager approval",
|
|
208
|
+
status: "Complete",
|
|
209
|
+
role: "Manager",
|
|
210
|
+
startedAt: "Oct 1, 11:45",
|
|
211
|
+
completedAt: "Oct 2, 09:10",
|
|
212
|
+
assignee: "Ava Brooks",
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
id: "step-c",
|
|
216
|
+
name: "Finance approval",
|
|
217
|
+
status: "Current",
|
|
218
|
+
role: "Finance",
|
|
219
|
+
startedAt: "Oct 3, 08:05",
|
|
220
|
+
assignee: "Liam Chen",
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
id: "step-d",
|
|
224
|
+
name: "Procurement",
|
|
225
|
+
status: "Upcoming",
|
|
226
|
+
role: "Procurement",
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: "execution-8832",
|
|
232
|
+
processName: "Time Off Request",
|
|
233
|
+
executionId: "#8832",
|
|
234
|
+
status: "Completed",
|
|
235
|
+
progress: "Finished",
|
|
236
|
+
startDate: "Started Oct 10",
|
|
237
|
+
lastActivity: "Completed yesterday",
|
|
238
|
+
completionDate: "Completed Oct 12",
|
|
239
|
+
completionIso: "2024-10-12T15:30:00Z",
|
|
240
|
+
cycleTimeHours: 36,
|
|
241
|
+
slaTargetHours: 48,
|
|
242
|
+
slaBreached: false,
|
|
243
|
+
participants: [
|
|
244
|
+
{ id: "participant-7", name: "Emma Davis", role: "Employee" },
|
|
245
|
+
{ id: "participant-8", name: "Reese Morgan", role: "Manager" },
|
|
246
|
+
],
|
|
247
|
+
steps: [
|
|
248
|
+
{
|
|
249
|
+
id: "step-e",
|
|
250
|
+
name: "Submit request",
|
|
251
|
+
status: "Complete",
|
|
252
|
+
role: "Employee",
|
|
253
|
+
startedAt: "Oct 10, 14:10",
|
|
254
|
+
completedAt: "Oct 10, 14:20",
|
|
255
|
+
assignee: "Emma Davis",
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
id: "step-f",
|
|
259
|
+
name: "Manager approval",
|
|
260
|
+
status: "Complete",
|
|
261
|
+
role: "Manager",
|
|
262
|
+
startedAt: "Oct 10, 15:00",
|
|
263
|
+
completedAt: "Oct 11, 09:42",
|
|
264
|
+
assignee: "Reese Morgan",
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
id: "step-g",
|
|
268
|
+
name: "HR notification",
|
|
269
|
+
status: "Complete",
|
|
270
|
+
role: "HR",
|
|
271
|
+
startedAt: "Oct 11, 10:05",
|
|
272
|
+
completedAt: "Oct 12, 11:30",
|
|
273
|
+
assignee: "HR Automation",
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
id: "execution-555",
|
|
279
|
+
processName: "Bug Report and Fix",
|
|
280
|
+
executionId: "#555",
|
|
281
|
+
status: "Failed",
|
|
282
|
+
progress: "Step 5 of 6",
|
|
283
|
+
startDate: "Started Sep 30",
|
|
284
|
+
lastActivity: "Failed at QA step",
|
|
285
|
+
currentStep: "QA test",
|
|
286
|
+
currentRole: "QA",
|
|
287
|
+
failureReason: "Automated regression suite failed on pipeline",
|
|
288
|
+
completionIso: "2024-10-11T11:00:00Z",
|
|
289
|
+
cycleTimeHours: 210,
|
|
290
|
+
slaTargetHours: 168,
|
|
291
|
+
slaBreached: true,
|
|
292
|
+
participants: [
|
|
293
|
+
{ id: "participant-9", name: "Caleb Finch", role: "Reporter" },
|
|
294
|
+
{ id: "participant-10", name: "Ivy Nguyen", role: "Developer" },
|
|
295
|
+
{ id: "participant-11", name: "Priya Desai", role: "QA" },
|
|
296
|
+
],
|
|
297
|
+
steps: [
|
|
298
|
+
{
|
|
299
|
+
id: "step-h",
|
|
300
|
+
name: "Report bug",
|
|
301
|
+
status: "Complete",
|
|
302
|
+
role: "Reporter",
|
|
303
|
+
startedAt: "Sep 30, 08:20",
|
|
304
|
+
completedAt: "Sep 30, 08:33",
|
|
305
|
+
assignee: "Caleb Finch",
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
id: "step-i",
|
|
309
|
+
name: "Triage",
|
|
310
|
+
status: "Complete",
|
|
311
|
+
role: "Triage Team",
|
|
312
|
+
startedAt: "Sep 30, 09:00",
|
|
313
|
+
completedAt: "Sep 30, 12:05",
|
|
314
|
+
assignee: "Ops Bot",
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
id: "step-j",
|
|
318
|
+
name: "Assign developer",
|
|
319
|
+
status: "Complete",
|
|
320
|
+
role: "Engineering Lead",
|
|
321
|
+
startedAt: "Sep 30, 12:10",
|
|
322
|
+
completedAt: "Sep 30, 12:45",
|
|
323
|
+
assignee: "Ivy Nguyen",
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
id: "step-k",
|
|
327
|
+
name: "Fix",
|
|
328
|
+
status: "Complete",
|
|
329
|
+
role: "Developer",
|
|
330
|
+
startedAt: "Oct 1, 09:05",
|
|
331
|
+
completedAt: "Oct 2, 16:20",
|
|
332
|
+
assignee: "Ivy Nguyen",
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
id: "step-l",
|
|
336
|
+
name: "QA test",
|
|
337
|
+
status: "Current",
|
|
338
|
+
role: "QA",
|
|
339
|
+
startedAt: "Oct 3, 10:00",
|
|
340
|
+
assignee: "Priya Desai",
|
|
341
|
+
notes: "Regression suite failure on payment gateway",
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: "step-m",
|
|
345
|
+
name: "Deploy",
|
|
346
|
+
status: "Upcoming",
|
|
347
|
+
role: "Release Manager",
|
|
348
|
+
},
|
|
349
|
+
],
|
|
350
|
+
},
|
|
351
|
+
]
|
|
352
|
+
|
|
353
|
+
export interface TrendPoint {
|
|
354
|
+
label: string
|
|
355
|
+
completed: number
|
|
356
|
+
failed: number
|
|
357
|
+
slaBreachRate: number
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
export interface SlaBucket {
|
|
361
|
+
label: string
|
|
362
|
+
percentage: number
|
|
363
|
+
tone: "good" | "warn" | "bad"
|
|
364
|
+
}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser-local desktop notification preference management.
|
|
3
|
+
*
|
|
4
|
+
* This module provides a self-service way for provider users to enable/disable
|
|
5
|
+
* desktop notifications in their current browser. The preference is:
|
|
6
|
+
* - Stored in localStorage (not server-side)
|
|
7
|
+
* - Scoped by userId + orgId (isolated across accounts/orgs)
|
|
8
|
+
* - Only available in browsers that support the Notification API
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Permission state of the browser Notification API
|
|
13
|
+
*/
|
|
14
|
+
export type NotificationPermissionState =
|
|
15
|
+
| "unsupported"
|
|
16
|
+
| "default"
|
|
17
|
+
| "granted"
|
|
18
|
+
| "denied"
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Current state of the desktop notification feature
|
|
22
|
+
*/
|
|
23
|
+
export type DesktopNotificationState = {
|
|
24
|
+
/** Whether the browser supports the Notification API */
|
|
25
|
+
isSupported: boolean
|
|
26
|
+
/** Current browser permission state */
|
|
27
|
+
permission: NotificationPermissionState
|
|
28
|
+
/** Whether the user has enabled notifications in this browser (local preference) */
|
|
29
|
+
isEnabled: boolean
|
|
30
|
+
/**
|
|
31
|
+
* Whether the bell should show as disabled (permission denied or
|
|
32
|
+
* explicitly disabled by user)
|
|
33
|
+
*/
|
|
34
|
+
isDisabled: boolean
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Key for localStorage - scoped by user and org
|
|
39
|
+
*/
|
|
40
|
+
const getPreferenceKey = (userId: string, orgId: string): string =>
|
|
41
|
+
`pf-desktop-notifications:${userId}:${orgId}`
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Check if the browser supports the Notification API
|
|
45
|
+
*/
|
|
46
|
+
export const isNotificationApiSupported = (): boolean => {
|
|
47
|
+
if (typeof window === "undefined") return false
|
|
48
|
+
return "Notification" in window
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Get the current browser permission state for notifications.
|
|
53
|
+
* Returns "unsupported" if the Notification API is not available.
|
|
54
|
+
*/
|
|
55
|
+
export const getBrowserPermissionState = (): NotificationPermissionState => {
|
|
56
|
+
if (!isNotificationApiSupported()) return "unsupported"
|
|
57
|
+
return Notification.permission as NotificationPermissionState
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Read the local preference from localStorage.
|
|
62
|
+
* Returns null if no preference is stored.
|
|
63
|
+
*/
|
|
64
|
+
const readLocalPreference = (userId: string, orgId: string): boolean | null => {
|
|
65
|
+
if (typeof window === "undefined") return null
|
|
66
|
+
|
|
67
|
+
try {
|
|
68
|
+
const key = getPreferenceKey(userId, orgId)
|
|
69
|
+
const stored = window.localStorage.getItem(key)
|
|
70
|
+
if (stored === null) return null
|
|
71
|
+
return stored === "enabled"
|
|
72
|
+
} catch {
|
|
73
|
+
// localStorage access can fail in some browser contexts (private mode, etc.)
|
|
74
|
+
return null
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Save the local preference to localStorage.
|
|
80
|
+
*/
|
|
81
|
+
const saveLocalPreference = (
|
|
82
|
+
userId: string,
|
|
83
|
+
orgId: string,
|
|
84
|
+
enabled: boolean,
|
|
85
|
+
): void => {
|
|
86
|
+
if (typeof window === "undefined") return
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
const key = getPreferenceKey(userId, orgId)
|
|
90
|
+
const value = enabled ? "enabled" : "disabled"
|
|
91
|
+
window.localStorage.setItem(key, value)
|
|
92
|
+
} catch {
|
|
93
|
+
// localStorage access can fail - fail silently
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const setDesktopNotificationPreference = (
|
|
98
|
+
userId: string,
|
|
99
|
+
orgId: string,
|
|
100
|
+
enabled: boolean,
|
|
101
|
+
): void => {
|
|
102
|
+
saveLocalPreference(userId, orgId, enabled)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Request browser permission for notifications.
|
|
107
|
+
* Returns the resulting permission state.
|
|
108
|
+
*/
|
|
109
|
+
export const requestNotificationPermission = async (): Promise<
|
|
110
|
+
Extract<NotificationPermissionState, "granted" | "denied" | "default">
|
|
111
|
+
> => {
|
|
112
|
+
if (!isNotificationApiSupported()) return "default"
|
|
113
|
+
|
|
114
|
+
try {
|
|
115
|
+
const result = await Notification.requestPermission()
|
|
116
|
+
return result as Extract<
|
|
117
|
+
NotificationPermissionState,
|
|
118
|
+
"granted" | "denied" | "default"
|
|
119
|
+
>
|
|
120
|
+
} catch {
|
|
121
|
+
// requestPermission can throw in some contexts
|
|
122
|
+
return "default"
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Get the current desktop notification state.
|
|
128
|
+
* This is a synchronous check that reads current permission and stored preference.
|
|
129
|
+
*/
|
|
130
|
+
export const getDesktopNotificationState = (
|
|
131
|
+
userId: string,
|
|
132
|
+
orgId: string,
|
|
133
|
+
): DesktopNotificationState => {
|
|
134
|
+
const isSupported = isNotificationApiSupported()
|
|
135
|
+
const permission = getBrowserPermissionState()
|
|
136
|
+
|
|
137
|
+
if (!isSupported || permission === "unsupported") {
|
|
138
|
+
return {
|
|
139
|
+
isSupported: false,
|
|
140
|
+
permission: "unsupported",
|
|
141
|
+
isEnabled: false,
|
|
142
|
+
isDisabled: true,
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const localPreference = readLocalPreference(userId, orgId)
|
|
147
|
+
// If permission is denied, the feature is effectively disabled regardless of preference
|
|
148
|
+
const isEnabled = permission === "granted" && localPreference === true
|
|
149
|
+
const isDisabled = permission === "denied" || localPreference === false
|
|
150
|
+
|
|
151
|
+
return {
|
|
152
|
+
isSupported: true,
|
|
153
|
+
permission,
|
|
154
|
+
isEnabled,
|
|
155
|
+
isDisabled,
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Attempt to enable desktop notifications.
|
|
161
|
+
* Requests browser permission and persists the preference if granted.
|
|
162
|
+
*
|
|
163
|
+
* Returns the new state after attempting to enable.
|
|
164
|
+
*/
|
|
165
|
+
export const enableDesktopNotifications = async (
|
|
166
|
+
userId: string,
|
|
167
|
+
orgId: string,
|
|
168
|
+
): Promise<DesktopNotificationState> => {
|
|
169
|
+
const permission = getBrowserPermissionState()
|
|
170
|
+
|
|
171
|
+
if (!isNotificationApiSupported() || permission === "unsupported") {
|
|
172
|
+
return {
|
|
173
|
+
isSupported: false,
|
|
174
|
+
permission: "unsupported",
|
|
175
|
+
isEnabled: false,
|
|
176
|
+
isDisabled: true,
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// If already granted, just enable and save
|
|
181
|
+
if (permission === "granted") {
|
|
182
|
+
saveLocalPreference(userId, orgId, true)
|
|
183
|
+
return {
|
|
184
|
+
isSupported: true,
|
|
185
|
+
permission: "granted",
|
|
186
|
+
isEnabled: true,
|
|
187
|
+
isDisabled: false,
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// If denied, we can't enable - user must change browser settings
|
|
192
|
+
if (permission === "denied") {
|
|
193
|
+
return {
|
|
194
|
+
isSupported: true,
|
|
195
|
+
permission: "denied",
|
|
196
|
+
isEnabled: false,
|
|
197
|
+
isDisabled: true,
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Request permission
|
|
202
|
+
const newPermission = await requestNotificationPermission()
|
|
203
|
+
|
|
204
|
+
if (newPermission === "granted") {
|
|
205
|
+
saveLocalPreference(userId, orgId, true)
|
|
206
|
+
return {
|
|
207
|
+
isSupported: true,
|
|
208
|
+
permission: "granted",
|
|
209
|
+
isEnabled: true,
|
|
210
|
+
isDisabled: false,
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Permission denied or dismissed - don't save enabled state
|
|
215
|
+
// If denied, reflect that in the UI
|
|
216
|
+
return {
|
|
217
|
+
isSupported: true,
|
|
218
|
+
permission: newPermission,
|
|
219
|
+
isEnabled: false,
|
|
220
|
+
isDisabled: newPermission === "denied",
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Disable desktop notifications.
|
|
226
|
+
* Clears the local preference.
|
|
227
|
+
*/
|
|
228
|
+
export const disableDesktopNotifications = (
|
|
229
|
+
userId: string,
|
|
230
|
+
orgId: string,
|
|
231
|
+
): DesktopNotificationState => {
|
|
232
|
+
const permission = getBrowserPermissionState()
|
|
233
|
+
|
|
234
|
+
if (!isNotificationApiSupported() || permission === "unsupported") {
|
|
235
|
+
return {
|
|
236
|
+
isSupported: false,
|
|
237
|
+
permission: "unsupported",
|
|
238
|
+
isEnabled: false,
|
|
239
|
+
isDisabled: true,
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
saveLocalPreference(userId, orgId, false)
|
|
244
|
+
|
|
245
|
+
return {
|
|
246
|
+
isSupported: true,
|
|
247
|
+
permission,
|
|
248
|
+
isEnabled: false,
|
|
249
|
+
isDisabled: true,
|
|
250
|
+
}
|
|
251
|
+
}
|