@processfocus/runtime-local 0.1.0-next.2 → 0.1.0-next.4
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 +51 -253
- package/dist/authentication-server.mjs +52 -84
- package/dist/chunk-3wzp2sax.js +4806 -0
- package/dist/chunk-5kjvzbwr.js +512 -0
- package/dist/chunk-egeb4821.js +156 -0
- package/dist/chunk-q5v72erd.js +241 -0
- package/dist/{chunk-yhzbn4vx.js → chunk-wvbz0nmd.js} +19485 -34180
- package/dist/{chunk-352j1ayk.js → chunk-y8fnwbx0.js} +51781 -36259
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/actions.ts +12 -12
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/delegations-client.tsx +31 -21
- package/dist/dashboard-source/apps/frontend/app/(protected)/act-on-behalf/page.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/client-index.tsx +1 -12
- package/dist/dashboard-source/apps/frontend/app/(protected)/connected-apps/disconnect-form.tsx +57 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/connected-apps/page.tsx +97 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/client.tsx +1 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/@modal/(.)[executionId]/process-state/page.tsx +2 -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 +3 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/[executionId]/process-state/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/client-layout.tsx +19 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/default.tsx +6 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/executions-client.tsx +1637 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/layout.tsx +5 -7
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/page.tsx +4 -1589
- package/dist/dashboard-source/apps/frontend/app/(protected)/executions/process-state-page-client.tsx +1 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/layout.tsx +41 -33
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/(.)item/[id]/client.tsx +11 -17
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/@modal/(.)item/[id]/page.tsx +2 -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 +169 -18
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/[...listPath]/page.tsx +21 -14
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-create-form.tsx +36 -18
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-item-edit-form.tsx +22 -28
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-item-load-error.tsx +49 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/components/list-schema-form.tsx +28 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/default.tsx +6 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/metric-control-url-state.ts +7 -16
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/use-list-deleted-callback.ts +4 -6
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/hooks/use-list-item-detail.ts +45 -142
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/item/[id]/client.tsx +10 -20
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/item/[id]/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/layout.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/lib/list-process-dialog.tsx +72 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/lib/list-refresh-provider.tsx +65 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/lib/list-refresh.ts +162 -16
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/utils.tsx +19 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/org-chart/page.tsx +4 -9
- package/dist/dashboard-source/apps/frontend/app/(protected)/page.tsx +4 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/actions.ts +15 -18
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/page.tsx +12 -6
- package/dist/dashboard-source/apps/frontend/app/(protected)/passkeys/passkeys-client.tsx +7 -16
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/(.)start/[...startStepPath]/client.tsx +26 -48
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/(.)start/[...startStepPath]/page.tsx +4 -7
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/@modal/default.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/client-layout.tsx +28 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/client.tsx +1 -3
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/start-process-form.tsx +193 -117
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/default.tsx +6 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/layout.tsx +7 -9
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/page.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/processes-client.tsx +60 -204
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/start/[...startStepPath]/client.tsx +12 -51
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/start/[...startStepPath]/page.tsx +27 -4
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/page.tsx +5 -4
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/workflow-flow.tsx +0 -5
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/workflow/[...processPath]/workflow-form-preview-sheet.tsx +26 -19
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/[[...tab]]/page.tsx +5 -2
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-authorize.ts +85 -9
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/cedar-types.ts +12 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/explorer.tsx +66 -4
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/layout.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/cedar/load-handbook.ts +41 -13
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/[invitationId]/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/invitation-detail-client.tsx +442 -365
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/new/page.tsx +8 -2
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations/page.tsx +7 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/invitations-table.tsx +61 -43
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/page.tsx +6 -67
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/providers/page.tsx +7 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/roles/page.tsx +7 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/settings-client.tsx +111 -189
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/settings-page.tsx +86 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/client.tsx +141 -256
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/tokens/page.tsx +2 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/page.tsx +7 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users-table.tsx +6 -4
- package/dist/dashboard-source/apps/frontend/app/(protected)/stats/[...statsPath]/page.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/(.)complete/[...stepPath]/client.tsx +30 -9
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/@modal/(.)complete/[...stepPath]/page.tsx +3 -1
- 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 +2 -4
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/complete/[...stepPath]/page.tsx +3 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/complete-todo-form.tsx +47 -54
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/public-completion-correction-form.tsx +37 -54
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/components/todo-form-actions.tsx +1 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/correct/[...stepPath]/page.tsx +3 -1
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/default.tsx +6 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/layout.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/lib/mobile-todo-list.ts +4 -25
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/page.tsx +4 -1315
- package/dist/dashboard-source/apps/frontend/app/(protected)/to-dos/to-dos-client.tsx +1282 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/callback/route.ts +81 -65
- package/dist/dashboard-source/apps/frontend/app/api/auth/delegation/route.ts +8 -2
- package/dist/dashboard-source/apps/frontend/app/api/auth/login/route.ts +0 -1
- package/dist/dashboard-source/apps/frontend/app/api/auth/logout/route.ts +10 -5
- package/dist/dashboard-source/apps/frontend/app/api/auth/passkey/start/route.ts +1 -3
- package/dist/dashboard-source/apps/frontend/app/api/auth/refresh/route.ts +0 -1
- package/dist/dashboard-source/apps/frontend/app/api/auth/revalidate-google/route.ts +68 -0
- package/dist/dashboard-source/apps/frontend/app/api/auth/switch-role/route.ts +1 -3
- package/dist/dashboard-source/apps/frontend/app/api/dev/import-events/route.ts +69 -1
- package/dist/dashboard-source/apps/frontend/app/api/embed/lookup/route.ts +25 -7
- package/dist/dashboard-source/apps/frontend/app/api/embed/submit/route.ts +1 -2
- package/dist/dashboard-source/apps/frontend/app/api/public/start/[address]/route.ts +49 -0
- package/dist/dashboard-source/apps/frontend/app/api/public/to-dos/lookup/route.ts +4 -3
- package/dist/dashboard-source/apps/frontend/app/api/revalidate/route.ts +15 -4
- package/dist/dashboard-source/apps/frontend/app/app-shell.tsx +14 -6
- package/dist/dashboard-source/apps/frontend/app/cli-auth/route.ts +2 -1
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/embed-client.tsx +31 -18
- package/dist/dashboard-source/apps/frontend/app/embed/[...startStepPath]/page.tsx +5 -1
- package/dist/dashboard-source/apps/frontend/app/login/page.tsx +4 -4
- package/dist/dashboard-source/apps/frontend/app/login/passkey-button.tsx +11 -6
- package/dist/dashboard-source/apps/frontend/app/login/passkey-help/page.tsx +67 -0
- package/dist/dashboard-source/apps/frontend/app/mcp/[[...endpoint]]/route.ts +44 -0
- package/dist/dashboard-source/apps/frontend/app/public/form/[token]/public-todo-client.tsx +44 -25
- package/dist/dashboard-source/apps/frontend/app/public/start/[address]/form/page.tsx +10 -0
- package/dist/dashboard-source/apps/frontend/app/public/start/[address]/layout.tsx +32 -0
- package/dist/dashboard-source/apps/frontend/app/public/start/[address]/page-client.tsx +319 -0
- package/dist/dashboard-source/apps/frontend/app/public/start/[address]/page-content.tsx +41 -0
- package/dist/dashboard-source/apps/frontend/app/public/start/[address]/page.tsx +10 -0
- package/dist/dashboard-source/apps/frontend/app/public.css +1 -1
- package/dist/dashboard-source/apps/frontend/app/register/passkey/register-passkey-client.tsx +17 -0
- package/dist/dashboard-source/apps/frontend/components/DashboardSection.tsx +9 -15
- package/dist/dashboard-source/apps/frontend/components/Header.tsx +14 -8
- package/dist/dashboard-source/apps/frontend/components/anonymous-page-link.tsx +57 -0
- package/dist/dashboard-source/apps/frontend/components/anonymous-start-form.tsx +24 -0
- package/dist/dashboard-source/apps/frontend/components/app-sidebar.tsx +21 -7
- package/dist/dashboard-source/apps/frontend/components/auth-provider.tsx +12 -7
- package/dist/dashboard-source/apps/frontend/components/browser-only.tsx +19 -0
- package/dist/dashboard-source/apps/frontend/components/config-provider.tsx +0 -1
- package/dist/dashboard-source/apps/frontend/components/delegation-expiry.tsx +24 -13
- package/dist/dashboard-source/apps/frontend/components/form-dialog-content.tsx +22 -2
- package/dist/dashboard-source/apps/frontend/components/journey-timeline.tsx +52 -45
- package/dist/dashboard-source/apps/frontend/components/notification-bell.tsx +0 -1
- package/dist/dashboard-source/apps/frontend/components/sidebar-lists.tsx +0 -1
- package/dist/dashboard-source/apps/frontend/components/token-refresh-scheduler.tsx +38 -11
- package/dist/dashboard-source/apps/frontend/components/ui/sidebar.tsx +0 -1
- package/dist/dashboard-source/apps/frontend/components/ui/tab-pill.tsx +26 -15
- package/dist/dashboard-source/apps/frontend/components/workflow/step-node.tsx +0 -1
- package/dist/dashboard-source/apps/frontend/components/workflow/workflow-edge.tsx +5 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-form-metadata.ts +21 -10
- package/dist/dashboard-source/apps/frontend/hooks/use-process-draft.ts +173 -0
- package/dist/dashboard-source/apps/frontend/hooks/use-weekly-execution-stats.ts +1 -3
- package/dist/dashboard-source/apps/frontend/lib/anonymous-page-form-values.ts +6 -0
- package/dist/dashboard-source/apps/frontend/lib/anonymous-page-server.ts +65 -0
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/adapter.ts +9 -3
- package/dist/dashboard-source/apps/frontend/lib/appsync-events/client.ts +7 -340
- package/dist/dashboard-source/apps/frontend/lib/auth/client-session.ts +2 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/delegations.ts +9 -7
- package/dist/dashboard-source/apps/frontend/lib/auth/google-revalidation.ts +111 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/logout.ts +1 -1
- package/dist/dashboard-source/apps/frontend/lib/auth/passkeys.ts +28 -30
- package/dist/dashboard-source/apps/frontend/lib/auth/providers.ts +10 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/realtime-session-token.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/auth/reauthentication-state.ts +4 -4
- package/dist/dashboard-source/apps/frontend/lib/auth/session-admission.ts +11 -7
- package/dist/dashboard-source/apps/frontend/lib/auth/session.ts +27 -10
- package/dist/dashboard-source/apps/frontend/lib/auth/ssr-session.ts +76 -9
- package/dist/dashboard-source/apps/frontend/lib/auth/verify-passkey.ts +25 -3
- package/dist/dashboard-source/apps/frontend/lib/collections/collection-provider-factory.tsx +115 -23
- package/dist/dashboard-source/apps/frontend/lib/collections/draft-process-execution.ts +1 -8
- package/dist/dashboard-source/apps/frontend/lib/collections/execution.ts +6 -2
- package/dist/dashboard-source/apps/frontend/lib/collections/graphql-stream.ts +21 -1
- package/dist/dashboard-source/apps/frontend/lib/collections/process-collection-provider.tsx +3 -0
- package/dist/dashboard-source/apps/frontend/lib/collections/process.ts +8 -2
- package/dist/dashboard-source/apps/frontend/lib/collections/replication-factory.ts +16 -4
- package/dist/dashboard-source/apps/frontend/lib/collections/todo.ts +1 -1
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-query-invalidation.tsx +66 -9
- package/dist/dashboard-source/apps/frontend/lib/dev/import-completed-refresh.ts +10 -6
- package/dist/dashboard-source/apps/frontend/lib/effect/navigation.ts +4 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/page-runtime.ts +29 -0
- package/dist/dashboard-source/apps/frontend/lib/effect/params.ts +18 -12
- package/dist/dashboard-source/apps/frontend/lib/effect/run-effect.ts +1 -1
- package/dist/dashboard-source/apps/frontend/lib/effect/runtime.ts +19 -23
- package/dist/dashboard-source/apps/frontend/lib/effect/services/access-token.ts +9 -12
- package/dist/dashboard-source/apps/frontend/lib/effect/services/authorization.ts +12 -12
- package/dist/dashboard-source/apps/frontend/lib/effect/services/form-validation.ts +20 -18
- package/dist/dashboard-source/apps/frontend/lib/effect/services/graphql.ts +32 -16
- package/dist/dashboard-source/apps/frontend/lib/embed-form-server.ts +35 -0
- package/dist/dashboard-source/apps/frontend/lib/embed-manifest.ts +10 -103
- package/dist/dashboard-source/apps/frontend/lib/forms/invitation.ts +43 -0
- package/dist/dashboard-source/apps/frontend/lib/forms/provider-user.ts +64 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-form-loaders.ts +40 -0
- package/dist/dashboard-source/apps/frontend/lib/frontend-manifest.ts +1 -33
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/gql.ts +123 -33
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/graphql.ts +168 -30
- package/dist/dashboard-source/apps/frontend/lib/generated/gql/index.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/anonymous-page.ts +27 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/dependent-lookup-query.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/list-queries.ts +34 -29
- package/dist/dashboard-source/apps/frontend/lib/graphql/lookup-provider.tsx +82 -10
- package/dist/dashboard-source/apps/frontend/lib/graphql/org-chart-operations.ts +2 -5
- package/dist/dashboard-source/apps/frontend/lib/graphql/queries.ts +25 -4
- package/dist/dashboard-source/apps/frontend/lib/graphql/server-client.ts +11 -0
- package/dist/dashboard-source/apps/frontend/lib/graphql/settings-queries.ts +13 -104
- package/dist/dashboard-source/apps/frontend/lib/graphql/user-queries.ts +11 -4
- package/dist/dashboard-source/apps/frontend/lib/graphql/workflow-operations.ts +1 -3
- package/dist/dashboard-source/apps/frontend/lib/graphql/workflow-queries.ts +1 -0
- package/dist/dashboard-source/apps/frontend/lib/list-detail-selection.ts +54 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/executions.ts +110 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/list-writes.ts +395 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/lists.ts +263 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/oauth.ts +889 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/origin.ts +50 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/processes.ts +436 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/read-tool.ts +72 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/result.ts +4 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/server.ts +71 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/store.ts +107 -0
- package/dist/dashboard-source/apps/frontend/lib/mcp/todos.ts +260 -0
- package/dist/dashboard-source/apps/frontend/lib/notifications/notification-preference.ts +0 -1
- package/dist/dashboard-source/apps/frontend/lib/notifications/todo-notification-observer.ts +0 -5
- package/dist/dashboard-source/apps/frontend/lib/org-chart-data.ts +0 -2
- package/dist/dashboard-source/apps/frontend/lib/org-identity.ts +6 -4
- package/dist/dashboard-source/apps/frontend/lib/organisation-form-loaders.ts +4 -0
- package/dist/dashboard-source/apps/frontend/lib/public-todo-form-runtime.ts +0 -1
- package/dist/dashboard-source/apps/frontend/lib/public-todo-model.ts +39 -139
- package/dist/dashboard-source/apps/frontend/lib/public-todo-server.ts +17 -16
- package/dist/dashboard-source/apps/frontend/lib/query-client.ts +0 -1
- package/dist/dashboard-source/apps/frontend/lib/todo-utils.ts +1 -77
- package/dist/dashboard-source/apps/frontend/lib/workflow/layout.ts +3 -7
- package/dist/dashboard-source/apps/frontend/next.config.ts +33 -13
- package/dist/dashboard-source/apps/frontend/package.json +47 -47
- package/dist/dashboard-source/apps/frontend/proxy.ts +72 -14
- package/dist/dashboard-source/modules/auth-local-cedar/src/index.ts +0 -3
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/auth-local-cedar.ts +165 -233
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/cedar-reload-notifier.ts +4 -3
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/config-base.ts +111 -75
- package/dist/dashboard-source/modules/auth-local-cedar/src/lib/policy-watcher.ts +14 -18
- package/dist/dashboard-source/modules/auth-policy/src/index.ts +1 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/auth-policy.ts +19 -37
- package/dist/dashboard-source/modules/auth-policy/src/lib/current-principal.ts +33 -29
- package/dist/dashboard-source/modules/auth-policy/src/lib/policy-revision.ts +23 -0
- package/dist/dashboard-source/modules/auth-policy/src/lib/types.ts +24 -49
- package/dist/dashboard-source/modules/auth-session/src/index.ts +4 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/project-subscription.ts +13 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/realtime-recipient.ts +10 -2
- package/dist/dashboard-source/modules/auth-session/src/lib/subjects.ts +82 -8
- package/dist/dashboard-source/modules/auth-session/src/lib/workload-access.ts +48 -0
- package/dist/dashboard-source/modules/auth-session/src/lib/workload-audit.ts +52 -0
- package/dist/dashboard-source/modules/aws-common/src/index.ts +0 -1
- package/dist/dashboard-source/modules/effect-json-logger/src/lib/effect-json-logger.ts +6 -9
- package/dist/dashboard-source/modules/form/src/hooks/use-local-storage.ts +5 -3
- package/dist/dashboard-source/modules/form/src/index.ts +1 -10
- package/dist/dashboard-source/modules/form/src/lib/effect-schema-form.tsx +1271 -0
- package/dist/dashboard-source/modules/form/src/lib/form-actions.ts +26 -0
- package/dist/dashboard-source/modules/form/src/lib/form-prefill.tsx +79 -0
- package/dist/dashboard-source/modules/form/src/lib/initial-focus.ts +31 -0
- package/dist/dashboard-source/modules/form/src/lib/lookup-context.tsx +18 -0
- package/dist/dashboard-source/modules/form/src/lib/plugin-registry.ts +4 -0
- package/dist/dashboard-source/modules/form/src/lib/plugin-scripts.ts +26 -0
- package/dist/dashboard-source/modules/form/src/lib/registered-plugin-field.tsx +57 -0
- package/dist/dashboard-source/modules/form/src/lib/schema-lookup.tsx +124 -0
- package/dist/dashboard-source/modules/form/src/lib/schema-typeahead.tsx +522 -0
- package/dist/dashboard-source/modules/form/src/lib/validation-logic.ts +172 -0
- package/dist/dashboard-source/modules/form-schema/src/index.ts +4 -1
- package/dist/dashboard-source/modules/form-schema/src/lib/annotation-helpers.ts +19 -14
- package/dist/dashboard-source/modules/form-schema/src/lib/email.ts +13 -11
- package/dist/dashboard-source/modules/form-schema/src/lib/field-count.ts +15 -13
- package/dist/dashboard-source/modules/form-schema/src/lib/form-annotations.ts +14 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/form-presentation.ts +33 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/form-schema.ts +186 -80
- package/dist/dashboard-source/modules/form-schema/src/lib/number-from-string.ts +26 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/phone.ts +8 -7
- package/dist/dashboard-source/modules/form-schema/src/lib/public-completion-correction.ts +7 -0
- package/dist/dashboard-source/modules/form-schema/src/lib/search-lookup-items.ts +27 -0
- package/dist/dashboard-source/modules/form-submission-schema/src/index.ts +5 -0
- package/dist/dashboard-source/modules/form-submission-schema/src/lib/executable-rules.ts +379 -0
- package/dist/dashboard-source/modules/form-submission-schema/src/lib/form-submission-schema.ts +475 -0
- package/dist/dashboard-source/modules/form-submission-schema/src/lib/json-schema.ts +58 -0
- package/dist/dashboard-source/modules/form-submission-schema/src/lib/schema-defaults.ts +158 -0
- package/dist/dashboard-source/modules/form-submission-schema/src/lib/submission-utils.ts +75 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/lib/browser-plugin-artifact.ts +46 -0
- package/dist/dashboard-source/modules/frontend-manifest/src/lib/frontend-manifest.ts +37 -30
- package/dist/dashboard-source/modules/frontend-plugin-host/src/lib/frontend-plugin-host.ts +9 -1
- package/dist/dashboard-source/modules/openauth/src/client.ts +25 -17
- package/dist/dashboard-source/modules/openauth/src/util.ts +16 -0
- package/dist/dashboard-source/modules/{aws-common/src/lib/project-balance-admission.ts → project-accounting/src/admission.ts} +4 -8
- package/dist/dashboard-source/modules/realtime-client/src/appsync-client.ts +377 -0
- package/dist/dashboard-source/modules/realtime-client/src/index.ts +5 -0
- package/dist/dashboard-source/modules/realtime-client/src/subscription-presence.ts +163 -0
- package/dist/dashboard-source/modules/request-time/src/lib/request-time.ts +6 -24
- package/dist/dashboard-source/modules/rxdb-collections/generated/execution-schema.json +28 -21
- package/dist/dashboard-source/modules/rxdb-collections/src/lib/rxdb-collections.ts +25 -18
- package/dist/dashboard-source/modules/rxdb-collections/src/lib/to-rxdb-schema.ts +60 -10
- package/dist/dashboard-source/modules/shadcn-components/src/index.ts +18 -2
- package/dist/dashboard-source/modules/shadcn-components/src/lib/date-calendar.tsx +93 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/date-field.tsx +147 -48
- package/dist/dashboard-source/modules/shadcn-components/src/lib/date-time-display.tsx +273 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/local-date-time-input.tsx +108 -0
- package/dist/dashboard-source/modules/shadcn-components/src/lib/lookup-field.tsx +237 -351
- package/dist/dashboard-source/modules/shadcn-components/src/lib/ui/popover.tsx +2 -1
- package/dist/dashboard-source.json +47 -47
- package/dist/graphql-server.mjs +272 -200
- package/dist/job-worker-supervisor.mjs +262 -0
- package/dist/job-worker.mjs +234 -133
- package/dist/main.mjs +30 -6
- package/dist/prepare-dashboard.mjs +8 -8
- package/dist/resources/cedar/policies.cedar +80 -38
- package/dist/resources/cedar/schema.cedarschema +39 -21
- package/dist/resources/graphql-schema/rxdb.graphql +2 -0
- package/dist/resources/graphql-schema/system.graphql +191 -51
- package/package.json +63 -62
- package/dist/chunk-6ntmymmx.js +0 -85
- package/dist/dashboard-source/apps/frontend/app/(protected)/lists/utils.ts +0 -20
- package/dist/dashboard-source/apps/frontend/app/(protected)/processes/components/process-form-actions.tsx +0 -105
- package/dist/dashboard-source/apps/frontend/hooks/use-draft-process-save.ts +0 -189
- package/dist/dashboard-source/apps/frontend/hooks/use-draft-state.ts +0 -79
- package/dist/dashboard-source/apps/frontend/hooks/use-processes-query.ts +0 -56
- package/dist/dashboard-source/modules/form/src/lib/ajv-standard-schema.ts +0 -152
- package/dist/dashboard-source/modules/form/src/lib/client-components-to-form.tsx +0 -1421
- package/dist/dashboard-source/modules/form/src/lib/friendly-validation-message.ts +0 -85
- package/dist/dashboard-source/modules/form/src/lib/walker.tsx +0 -1549
- package/dist/dashboard-source/modules/form-client-representation/src/lib/client-form-definition.ts +0 -440
- package/dist/dashboard-source/modules/form-client-representation/src/lib/plugin-registry.ts +0 -13
- package/dist/dashboard-source/modules/form-client-representation/src/lib/types.ts +0 -336
- package/dist/dashboard-source/modules/form-rule/src/index.ts +0 -21
- package/dist/dashboard-source/modules/form-rule/src/lib/evaluator.ts +0 -531
- package/dist/dashboard-source/modules/form-rule/src/lib/paths.ts +0 -102
- package/dist/dashboard-source/modules/form-rule/src/lib/types.ts +0 -121
- package/dist/dashboard-source/modules/form-schema/src/lib/property-signature.ts +0 -45
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Effect } from "effect"
|
|
2
|
+
import { redirect } from "next/navigation"
|
|
3
|
+
import type { ProviderUserSession } from "../../../../../modules/auth-session/src/index.ts"
|
|
4
|
+
import { SettingsClient, type SettingsSection } from "./settings-client.tsx"
|
|
5
|
+
import { getSessionWithToken } from "@/lib/auth/session"
|
|
6
|
+
import { BasePageWithAuthorization } from "@/lib/effect/runtime"
|
|
7
|
+
import {
|
|
8
|
+
checkFeaturePermissions,
|
|
9
|
+
hasAnySettingsPermission,
|
|
10
|
+
} from "@/lib/effect/services"
|
|
11
|
+
|
|
12
|
+
const SettingsPageContent = Effect.fn("SettingsPage")(function* ({
|
|
13
|
+
section,
|
|
14
|
+
}: {
|
|
15
|
+
section?: SettingsSection
|
|
16
|
+
}) {
|
|
17
|
+
const sessionResult = yield* getSessionWithToken.pipe(
|
|
18
|
+
Effect.catch(() => Effect.succeed(null)),
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
if (!sessionResult || !("email" in sessionResult)) {
|
|
22
|
+
return (
|
|
23
|
+
<div className="flex-1 overflow-y-auto px-6 pt-6 pb-16 sm:px-8 lg:px-12">
|
|
24
|
+
<div className="rounded-md border border-amber-200 bg-amber-50 p-6 text-amber-800 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-200">
|
|
25
|
+
<p className="font-medium">No settings available</p>
|
|
26
|
+
<p className="mt-1 text-sm">
|
|
27
|
+
You do not have permission to access any settings.
|
|
28
|
+
</p>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const permissions = yield* checkFeaturePermissions(
|
|
35
|
+
sessionResult as ProviderUserSession,
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
if (
|
|
39
|
+
!hasAnySettingsPermission(permissions) ||
|
|
40
|
+
(section &&
|
|
41
|
+
!(section === "providers"
|
|
42
|
+
? permissions.administerOAuthProviders
|
|
43
|
+
: permissions.administerUsers))
|
|
44
|
+
) {
|
|
45
|
+
return (
|
|
46
|
+
<div className="flex-1 overflow-y-auto px-6 pt-6 pb-16 sm:px-8 lg:px-12">
|
|
47
|
+
<div className="rounded-md border border-amber-200 bg-amber-50 p-6 text-amber-800 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-200">
|
|
48
|
+
<p className="font-medium">No settings available</p>
|
|
49
|
+
<p className="mt-1 text-sm">
|
|
50
|
+
You do not have permission to access any settings.
|
|
51
|
+
</p>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (!section) {
|
|
58
|
+
return yield* Effect.sync(() =>
|
|
59
|
+
redirect(
|
|
60
|
+
permissions.administerUsers ? "/settings/users" : "/settings/providers",
|
|
61
|
+
),
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<div className="flex-1 overflow-y-auto px-6 pt-6 pb-16 sm:px-8 lg:px-12">
|
|
67
|
+
<div className="mb-8">
|
|
68
|
+
<h2 className="text-2xl font-bold text-slate-900 dark:text-slate-50">
|
|
69
|
+
Users & Sign-in
|
|
70
|
+
</h2>
|
|
71
|
+
<p className="mt-2 text-slate-600 dark:text-slate-400">
|
|
72
|
+
Manage users, invitations, roles, and sign-in providers.
|
|
73
|
+
</p>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<SettingsClient
|
|
77
|
+
key={section}
|
|
78
|
+
activeTab={section}
|
|
79
|
+
canAdministerUsers={permissions.administerUsers}
|
|
80
|
+
canAdministerOAuthProviders={permissions.administerOAuthProviders}
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
)
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
export const SettingsPage = BasePageWithAuthorization.build(SettingsPageContent)
|
package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/client.tsx
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import { useQuery, useQueryClient } from "@tanstack/react-query"
|
|
4
|
+
import { Schema } from "effect"
|
|
4
5
|
import Link from "next/link"
|
|
5
6
|
import { useRouter } from "next/navigation"
|
|
6
7
|
import { useEffect, useState } from "react"
|
|
8
|
+
import { EffectSchemaForm } from "../../../../../../../modules/form/src/lib/effect-schema-form.tsx"
|
|
7
9
|
import { Button } from "../../../../../../../modules/shadcn-components/src/index.ts"
|
|
8
|
-
import {
|
|
9
|
-
import { Input } from "@/components/ui/input"
|
|
10
|
+
import { providerUserForm } from "@/lib/forms/provider-user"
|
|
10
11
|
import { useGraphqlClient } from "@/lib/graphql/client-provider"
|
|
11
12
|
import {
|
|
12
13
|
fetchAllRoles,
|
|
@@ -14,138 +15,64 @@ import {
|
|
|
14
15
|
saveProviderUser,
|
|
15
16
|
} from "@/lib/graphql/user-queries"
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
userId: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function UserEditClient({ userId }: UserEditClientProps) {
|
|
18
|
+
export function UserEditClient({ userId }: { userId: string }) {
|
|
22
19
|
const router = useRouter()
|
|
23
20
|
const client = useGraphqlClient()
|
|
24
21
|
const queryClient = useQueryClient()
|
|
25
|
-
const [
|
|
26
|
-
const [error, setError] = useState<string | null>(null)
|
|
27
|
-
|
|
28
|
-
// Form state
|
|
29
|
-
const [selectedRoleIds, setSelectedRoleIds] = useState<string[]>([])
|
|
30
|
-
const [taskAssignmentEmail, setTaskAssignmentEmail] = useState(false)
|
|
31
|
-
const [executionFailureEmail, setExecutionFailureEmail] = useState(false)
|
|
32
|
-
const [formInitialized, setFormInitialized] = useState(false)
|
|
33
|
-
|
|
34
|
-
// Fetch user detail
|
|
22
|
+
const [formReady, setFormReady] = useState(false)
|
|
35
23
|
const {
|
|
36
24
|
data: userDetail,
|
|
37
25
|
isLoading: userLoading,
|
|
38
26
|
error: userError,
|
|
27
|
+
refetch: refetchUser,
|
|
39
28
|
} = useQuery({
|
|
40
29
|
queryKey: ["userDetail", userId],
|
|
41
30
|
queryFn: () => fetchUserDetail(client, userId),
|
|
42
31
|
})
|
|
43
|
-
|
|
44
|
-
// Fetch all roles
|
|
45
32
|
const {
|
|
46
|
-
data: roles
|
|
33
|
+
data: roles,
|
|
47
34
|
isLoading: rolesLoading,
|
|
48
35
|
error: rolesError,
|
|
36
|
+
refetch: refetchRoles,
|
|
49
37
|
} = useQuery({
|
|
50
38
|
queryKey: ["allRoles"],
|
|
51
39
|
queryFn: () => fetchAllRoles(client),
|
|
52
40
|
})
|
|
53
|
-
|
|
54
|
-
const loading = userLoading || rolesLoading
|
|
55
41
|
const queryError = userError || rolesError
|
|
56
42
|
|
|
57
|
-
//
|
|
43
|
+
// Next's Activity cache retains state on navigation, but reconnects effects.
|
|
44
|
+
// Reopen from current server values; ordinary background refetches keep edits.
|
|
58
45
|
useEffect(() => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
notificationPrefs?.notifications?.executionFailure?.email ?? false
|
|
67
|
-
setTaskAssignmentEmail(emailEnabled)
|
|
68
|
-
setExecutionFailureEmail(executionFailureEnabled)
|
|
69
|
-
setFormInitialized(true)
|
|
46
|
+
let active = true
|
|
47
|
+
setFormReady(false)
|
|
48
|
+
void Promise.all([refetchUser(), refetchRoles()]).then(() => {
|
|
49
|
+
if (active) setFormReady(true)
|
|
50
|
+
})
|
|
51
|
+
return () => {
|
|
52
|
+
active = false
|
|
70
53
|
}
|
|
71
|
-
}, [
|
|
72
|
-
|
|
73
|
-
const handleRoleToggle = (roleId: string) => {
|
|
74
|
-
setSelectedRoleIds((prev) =>
|
|
75
|
-
prev.includes(roleId)
|
|
76
|
-
? prev.filter((id) => id !== roleId)
|
|
77
|
-
: [...prev, roleId],
|
|
78
|
-
)
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
const handleSave = async () => {
|
|
82
|
-
if (!userDetail?.providerUser) return
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
setSaving(true)
|
|
86
|
-
setError(null)
|
|
87
|
-
|
|
88
|
-
const result = await saveProviderUser(
|
|
89
|
-
client,
|
|
90
|
-
userDetail.providerUser.id,
|
|
91
|
-
userId,
|
|
92
|
-
selectedRoleIds,
|
|
93
|
-
taskAssignmentEmail,
|
|
94
|
-
executionFailureEmail,
|
|
95
|
-
)
|
|
54
|
+
}, [refetchUser, refetchRoles])
|
|
96
55
|
|
|
97
|
-
|
|
98
|
-
const errors: string[] = []
|
|
99
|
-
|
|
100
|
-
if (result.providerUser.__typename === "UpdateProviderUserFailure") {
|
|
101
|
-
errors.push(result.providerUser.error)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (
|
|
105
|
-
result.notificationPreferences.__typename ===
|
|
106
|
-
"UpdateNotificationPreferencesFailure"
|
|
107
|
-
) {
|
|
108
|
-
errors.push(result.notificationPreferences.error)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
if (errors.length > 0) {
|
|
112
|
-
setError(errors.join("; "))
|
|
113
|
-
} else {
|
|
114
|
-
// Both succeeded
|
|
115
|
-
await queryClient.invalidateQueries({
|
|
116
|
-
queryKey: ["userDetail", userId],
|
|
117
|
-
})
|
|
118
|
-
router.push("/settings")
|
|
119
|
-
}
|
|
120
|
-
} catch (err) {
|
|
121
|
-
const message =
|
|
122
|
-
err instanceof Error ? err.message : "Failed to update user"
|
|
123
|
-
setError(message)
|
|
124
|
-
}
|
|
125
|
-
setSaving(false)
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (loading) {
|
|
56
|
+
if (!formReady || userLoading || rolesLoading) {
|
|
129
57
|
return (
|
|
130
58
|
<div className="flex items-center justify-center py-12">
|
|
131
59
|
<div className="h-8 w-8 animate-spin rounded-full border-4 border-slate-200 border-t-blue-600" />
|
|
132
60
|
</div>
|
|
133
61
|
)
|
|
134
62
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
63
|
+
const queryErrorBanner = queryError ? (
|
|
64
|
+
<div className="rounded-md border border-red-200 bg-red-50 p-4 text-red-700">
|
|
65
|
+
<p className="font-medium">Error</p>
|
|
66
|
+
<p className="text-sm">
|
|
67
|
+
{queryError instanceof Error
|
|
68
|
+
? queryError.message
|
|
69
|
+
: "Failed to load user data"}
|
|
70
|
+
</p>
|
|
71
|
+
</div>
|
|
72
|
+
) : null
|
|
73
|
+
if (queryError && (userDetail === undefined || roles === undefined)) {
|
|
74
|
+
return queryErrorBanner
|
|
147
75
|
}
|
|
148
|
-
|
|
149
76
|
if (!userDetail) {
|
|
150
77
|
return (
|
|
151
78
|
<div className="rounded-md border border-red-200 bg-red-50 p-4 text-red-700">
|
|
@@ -153,7 +80,6 @@ export function UserEditClient({ userId }: UserEditClientProps) {
|
|
|
153
80
|
</div>
|
|
154
81
|
)
|
|
155
82
|
}
|
|
156
|
-
|
|
157
83
|
if (!userDetail.providerUser) {
|
|
158
84
|
return (
|
|
159
85
|
<div className="rounded-md border border-amber-200 bg-amber-50 p-4 text-amber-700">
|
|
@@ -165,165 +91,124 @@ export function UserEditClient({ userId }: UserEditClientProps) {
|
|
|
165
91
|
)
|
|
166
92
|
}
|
|
167
93
|
|
|
94
|
+
const user = userDetail.providerUser
|
|
95
|
+
const schema = providerUserForm(
|
|
96
|
+
(roles ?? []).map((role) => ({
|
|
97
|
+
value: role.id,
|
|
98
|
+
label: role.name,
|
|
99
|
+
description: role.path,
|
|
100
|
+
})),
|
|
101
|
+
userDetail.provider,
|
|
102
|
+
userDetail.taskAssignmentEmailAvailable,
|
|
103
|
+
)
|
|
168
104
|
return (
|
|
169
105
|
<div className="mx-auto max-w-2xl space-y-6">
|
|
170
|
-
<h1 className="text-2xl font-bold">Edit
|
|
106
|
+
<h1 className="text-2xl font-bold">Edit User</h1>
|
|
171
107
|
<Link
|
|
172
108
|
className="inline-flex min-h-11 items-center text-sm font-medium underline underline-offset-4"
|
|
173
109
|
href={`/settings/users/${encodeURIComponent(userId)}/tokens`}
|
|
174
110
|
>
|
|
175
|
-
Manage tokens for{
|
|
176
|
-
{userDetail.providerUser.name || userDetail.providerUser.email}
|
|
111
|
+
Manage tokens for {user.name || user.email}
|
|
177
112
|
</Link>
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
113
|
+
{queryErrorBanner}
|
|
114
|
+
<EffectSchemaForm
|
|
115
|
+
key={userId}
|
|
116
|
+
schema={schema}
|
|
117
|
+
readOnlyCheckboxFields={["taskAssignmentEmail"]}
|
|
118
|
+
defaultValues={{
|
|
119
|
+
email: user.email,
|
|
120
|
+
firstName: user.firstName,
|
|
121
|
+
lastName: user.lastName,
|
|
122
|
+
fullName: user.name,
|
|
123
|
+
roleIds: [...new Set(user.roleIds)],
|
|
124
|
+
taskAssignmentEmail:
|
|
125
|
+
user.notificationPreferences?.notifications?.todoAssignment
|
|
126
|
+
?.email ?? false,
|
|
127
|
+
executionFailureEmail:
|
|
128
|
+
user.notificationPreferences?.notifications?.executionFailure
|
|
129
|
+
?.email ?? false,
|
|
130
|
+
}}
|
|
131
|
+
onSubmit={async (values) => {
|
|
132
|
+
try {
|
|
133
|
+
const submitted = Schema.decodeUnknownSync(
|
|
134
|
+
Schema.Struct({
|
|
135
|
+
...schema.fields.assignments.fields,
|
|
136
|
+
...schema.fields.notifications.fields,
|
|
137
|
+
taskAssignmentEmail: Schema.optional(
|
|
138
|
+
schema.fields.notifications.fields.taskAssignmentEmail,
|
|
139
|
+
),
|
|
140
|
+
}),
|
|
141
|
+
)(values)
|
|
142
|
+
const names =
|
|
143
|
+
userDetail.provider === "passkey"
|
|
144
|
+
? Schema.decodeUnknownSync(
|
|
145
|
+
Schema.Struct({
|
|
146
|
+
firstName: Schema.optional(Schema.String),
|
|
147
|
+
lastName: Schema.optional(Schema.String),
|
|
148
|
+
}),
|
|
149
|
+
)(values)
|
|
150
|
+
: undefined
|
|
151
|
+
const result = await saveProviderUser(
|
|
152
|
+
client,
|
|
153
|
+
user.id,
|
|
154
|
+
userId,
|
|
155
|
+
[...submitted.roleIds],
|
|
156
|
+
userDetail.taskAssignmentEmailAvailable
|
|
157
|
+
? submitted.taskAssignmentEmail
|
|
158
|
+
: undefined,
|
|
159
|
+
submitted.executionFailureEmail,
|
|
160
|
+
names
|
|
161
|
+
? {
|
|
162
|
+
firstName: names.firstName ?? "",
|
|
163
|
+
lastName: names.lastName ?? "",
|
|
164
|
+
}
|
|
165
|
+
: undefined,
|
|
166
|
+
)
|
|
167
|
+
const errors: { field: string; message: string }[] = []
|
|
168
|
+
if (
|
|
169
|
+
result.providerUser.__typename === "UpdateProviderUserFailure"
|
|
170
|
+
) {
|
|
171
|
+
errors.push({
|
|
172
|
+
field: "roleIds",
|
|
173
|
+
message: result.providerUser.error,
|
|
174
|
+
})
|
|
175
|
+
}
|
|
176
|
+
if (
|
|
177
|
+
result.notificationPreferences.__typename ===
|
|
178
|
+
"UpdateNotificationPreferencesFailure"
|
|
179
|
+
) {
|
|
180
|
+
errors.push({
|
|
181
|
+
field: "",
|
|
182
|
+
message: result.notificationPreferences.error,
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
if (errors.length > 0) return errors
|
|
186
|
+
await queryClient.invalidateQueries({
|
|
187
|
+
queryKey: ["userDetail", userId],
|
|
188
|
+
})
|
|
189
|
+
router.push("/settings/users")
|
|
190
|
+
return undefined
|
|
191
|
+
} catch (error) {
|
|
192
|
+
return [
|
|
193
|
+
{
|
|
194
|
+
field: "",
|
|
195
|
+
message:
|
|
196
|
+
error instanceof Error
|
|
197
|
+
? error.message
|
|
198
|
+
: "Failed to update user",
|
|
199
|
+
},
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
}}
|
|
203
|
+
>
|
|
204
|
+
{({ formState }) => (
|
|
205
|
+
<div className="flex justify-end">
|
|
206
|
+
<Button type="submit" disabled={formState.isSubmitting}>
|
|
207
|
+
{formState.isSubmitting ? "Saving..." : "Save"}
|
|
208
|
+
</Button>
|
|
233
209
|
</div>
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
<div className="space-y-2">
|
|
237
|
-
<label htmlFor="fullName" className="text-sm font-medium">
|
|
238
|
-
Full Name (auto-computed)
|
|
239
|
-
</label>
|
|
240
|
-
<Input
|
|
241
|
-
id="fullName"
|
|
242
|
-
type="text"
|
|
243
|
-
value={userDetail.providerUser.name}
|
|
244
|
-
disabled
|
|
245
|
-
className="bg-slate-50"
|
|
246
|
-
/>
|
|
247
|
-
</div>
|
|
248
|
-
</div>
|
|
249
|
-
|
|
250
|
-
<div className="space-y-4 rounded-lg border border-slate-200 bg-white p-6 dark:border-slate-700 dark:bg-slate-900">
|
|
251
|
-
<h2 className="text-lg font-semibold">Role Assignments</h2>
|
|
252
|
-
|
|
253
|
-
<div className="space-y-3">
|
|
254
|
-
{roles.map((role) => (
|
|
255
|
-
<div key={role.id} className="flex items-center gap-3">
|
|
256
|
-
<Checkbox
|
|
257
|
-
id={`role-${role.id}`}
|
|
258
|
-
checked={selectedRoleIds.includes(role.id)}
|
|
259
|
-
onCheckedChange={() => handleRoleToggle(role.id)}
|
|
260
|
-
disabled={saving}
|
|
261
|
-
/>
|
|
262
|
-
<label
|
|
263
|
-
htmlFor={`role-${role.id}`}
|
|
264
|
-
className="flex cursor-pointer flex-col"
|
|
265
|
-
>
|
|
266
|
-
<span className="font-medium">{role.name}</span>
|
|
267
|
-
<span className="text-sm text-slate-500">{role.path}</span>
|
|
268
|
-
</label>
|
|
269
|
-
</div>
|
|
270
|
-
))}
|
|
271
|
-
</div>
|
|
272
|
-
</div>
|
|
273
|
-
|
|
274
|
-
<div className="space-y-4 rounded-lg border border-slate-200 bg-white p-6 dark:border-slate-700 dark:bg-slate-900">
|
|
275
|
-
<h2 className="text-lg font-semibold">Notification Preferences</h2>
|
|
276
|
-
|
|
277
|
-
<div className="flex items-center gap-3">
|
|
278
|
-
<Checkbox
|
|
279
|
-
id="taskAssignmentEmail"
|
|
280
|
-
checked={taskAssignmentEmail}
|
|
281
|
-
onCheckedChange={(checked) => {
|
|
282
|
-
if (typeof checked === "boolean") {
|
|
283
|
-
setTaskAssignmentEmail(checked)
|
|
284
|
-
}
|
|
285
|
-
}}
|
|
286
|
-
disabled={saving}
|
|
287
|
-
/>
|
|
288
|
-
<label
|
|
289
|
-
htmlFor="taskAssignmentEmail"
|
|
290
|
-
className="flex cursor-pointer flex-col"
|
|
291
|
-
>
|
|
292
|
-
<span className="font-medium">Task Assignment Emails</span>
|
|
293
|
-
<span className="text-sm text-slate-500">
|
|
294
|
-
Send email notifications when new tasks are assigned
|
|
295
|
-
</span>
|
|
296
|
-
</label>
|
|
297
|
-
</div>
|
|
298
|
-
|
|
299
|
-
<div className="flex items-center gap-3">
|
|
300
|
-
<Checkbox
|
|
301
|
-
id="executionFailureEmail"
|
|
302
|
-
checked={executionFailureEmail}
|
|
303
|
-
onCheckedChange={(checked) => {
|
|
304
|
-
if (typeof checked === "boolean") {
|
|
305
|
-
setExecutionFailureEmail(checked)
|
|
306
|
-
}
|
|
307
|
-
}}
|
|
308
|
-
disabled={saving}
|
|
309
|
-
/>
|
|
310
|
-
<label
|
|
311
|
-
htmlFor="executionFailureEmail"
|
|
312
|
-
className="flex cursor-pointer flex-col"
|
|
313
|
-
>
|
|
314
|
-
<span className="font-medium">Execution failures</span>
|
|
315
|
-
<span className="text-sm text-slate-500">
|
|
316
|
-
Send email notifications for fatal execution failures
|
|
317
|
-
</span>
|
|
318
|
-
</label>
|
|
319
|
-
</div>
|
|
320
|
-
</div>
|
|
321
|
-
|
|
322
|
-
<div className="flex justify-end">
|
|
323
|
-
<Button onClick={handleSave} disabled={saving}>
|
|
324
|
-
{saving ? "Saving..." : "Save"}
|
|
325
|
-
</Button>
|
|
326
|
-
</div>
|
|
210
|
+
)}
|
|
211
|
+
</EffectSchemaForm>
|
|
327
212
|
</div>
|
|
328
213
|
)
|
|
329
214
|
}
|
package/dist/dashboard-source/apps/frontend/app/(protected)/settings/users/[userId]/tokens/page.tsx
CHANGED
|
@@ -4,6 +4,8 @@ import { listDelegations } from "@/app/(protected)/act-on-behalf/actions"
|
|
|
4
4
|
import { DelegationsClient } from "@/app/(protected)/act-on-behalf/delegations-client"
|
|
5
5
|
import { BasePage } from "@/lib/effect/runtime"
|
|
6
6
|
|
|
7
|
+
export const instant = false
|
|
8
|
+
|
|
7
9
|
// The issuer authorizes this selected owner and each operation independently.
|
|
8
10
|
// Inspection permission never implies permission to issue or replace a secret.
|
|
9
11
|
export default BasePage.build(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { DateTimeDisplay } from "../../../../../modules/shadcn-components/src/lib/date-time-display.tsx"
|
|
4
4
|
import {
|
|
5
5
|
CollectionTableCard,
|
|
6
6
|
type CollectionTableColumn,
|
|
@@ -54,9 +54,11 @@ const columns: CollectionTableColumn<User>[] = [
|
|
|
54
54
|
label: "Last Login",
|
|
55
55
|
cellClassName: "text-slate-500 dark:text-slate-400",
|
|
56
56
|
render: (user) =>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
user.lastLoggedIn ? (
|
|
58
|
+
<DateTimeDisplay kind="timestamp" value={user.lastLoggedIn} />
|
|
59
|
+
) : (
|
|
60
|
+
"Never"
|
|
61
|
+
),
|
|
60
62
|
},
|
|
61
63
|
]
|
|
62
64
|
|
|
@@ -5,6 +5,9 @@ import { StatsTimelineData } from "./stats-data-fetcher.tsx"
|
|
|
5
5
|
import { getSessionWithTokenAndExpiry } from "@/lib/auth/session"
|
|
6
6
|
import { fetchAvailableStatsViewsServer } from "@/lib/graphql/stats-views-server"
|
|
7
7
|
|
|
8
|
+
// The authenticated shell can omit this page while checking the session.
|
|
9
|
+
export const instant = false
|
|
10
|
+
|
|
8
11
|
interface PageProps {
|
|
9
12
|
params: Promise<{ statsPath: string[] }>
|
|
10
13
|
}
|