spine-framework 0.1.61 → 0.2.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/.framework/cli/commands/create-app.ts +1 -1
- package/.framework/cli/commands/dev.ts +215 -33
- package/.framework/cli/index.ts +37 -63
- package/.framework/functions/_shared/app-manifest.ts +8 -15
- package/.framework/functions/_shared/db.ts +11 -15
- package/.framework/functions/_shared/index.ts +0 -9
- package/.framework/functions/_shared/principal.ts +4 -62
- package/.framework/functions/_shared/resolve-ids.ts +6 -6
- package/.framework/functions/_shared/webhook-registry.ts +1 -1
- package/.framework/functions/admin-funnel.ts +104 -0
- package/.framework/functions/admin-install-funnel.ts +225 -0
- package/.framework/functions/admin-signals.ts +241 -0
- package/.framework/migrations/001_schema.sql +406 -0
- package/.framework/migrations/002_rls_and_functions.sql +710 -0
- package/.framework/migrations/003_system_data.sql +520 -0
- package/.framework/migrations/004_enhancements.sql +43 -0
- package/.framework/public/_redirects +3 -0
- package/.framework/public/spine-logo.jpg +0 -0
- package/.framework/public/spine-logo.svg +3 -0
- package/{scripts → .framework/scripts}/assemble-frontend.sh +1 -1
- package/{scripts → .framework/scripts}/assemble-functions.sh +1 -1
- package/{scripts → .framework/scripts}/assemble.sh +2 -8
- package/{scripts → .framework/scripts}/check-core-integrity.sh +0 -0
- package/.framework/seeds/link_types/account_cli_instances.json +9 -0
- package/.framework/seeds/types/funnel_signal_use.json +98 -0
- package/.framework/seeds/types/spine_instance.json +109 -0
- package/.framework/src/App.tsx +6 -4
- package/.framework/src/components/ui/accordion.tsx +1 -1
- package/.framework/src/components/ui/alert-dialog.tsx +1 -1
- package/.framework/src/components/ui/aspect-ratio.tsx +1 -1
- package/.framework/src/components/ui/avatar.tsx +1 -1
- package/.framework/src/components/ui/badge.tsx +2 -2
- package/.framework/src/components/ui/breadcrumb.tsx +2 -2
- package/.framework/src/components/ui/button-group.tsx +2 -2
- package/.framework/src/components/ui/button.tsx +2 -2
- package/.framework/src/components/ui/chart.tsx +6 -1
- package/.framework/src/components/ui/checkbox.tsx +1 -1
- package/.framework/src/components/ui/collapsible.tsx +1 -1
- package/.framework/src/components/ui/context-menu.tsx +1 -1
- package/.framework/src/components/ui/dialog.tsx +1 -1
- package/.framework/src/components/ui/direction.tsx +17 -1
- package/.framework/src/components/ui/dropdown-menu.tsx +1 -1
- package/.framework/src/components/ui/hover-card.tsx +1 -1
- package/.framework/src/components/ui/item.tsx +2 -2
- package/.framework/src/components/ui/label.tsx +1 -1
- package/.framework/src/components/ui/menubar.tsx +1 -1
- package/.framework/src/components/ui/navigation-menu.tsx +1 -1
- package/.framework/src/components/ui/popover.tsx +1 -1
- package/.framework/src/components/ui/progress.tsx +1 -1
- package/.framework/src/components/ui/radio-group.tsx +1 -1
- package/.framework/src/components/ui/scroll-area.tsx +1 -1
- package/.framework/src/components/ui/select.tsx +1 -1
- package/.framework/src/components/ui/separator.tsx +1 -1
- package/.framework/src/components/ui/sheet.tsx +1 -1
- package/.framework/src/components/ui/sidebar.tsx +6 -6
- package/.framework/src/components/ui/slider.tsx +1 -1
- package/.framework/src/components/ui/switch.tsx +1 -1
- package/.framework/src/components/ui/tabs.tsx +1 -1
- package/.framework/src/components/ui/toggle-group.tsx +1 -1
- package/.framework/src/components/ui/toggle.tsx +1 -1
- package/.framework/src/components/ui/tooltip.tsx +1 -1
- package/.framework/src/pages/auth/LoginPage.tsx +10 -9
- package/LICENSE.md +193 -0
- package/README.md +254 -0
- package/custom/.devin/skills/install-app/SKILL.md +39 -0
- package/custom/.devin/workflows/app-install.yaml +83 -0
- package/custom/README.md +79 -0
- package/docs/APPS.md +232 -0
- package/docs/ARCHITECTURE.md +246 -0
- package/docs/INSTALL.md +155 -0
- package/docs/README.md +170 -0
- package/docs/design-schema-spec.md +1837 -0
- package/docs/dev-guides/01-create-an-app.md +183 -0
- package/docs/dev-guides/02-create-a-function.md +178 -0
- package/docs/dev-guides/03-create-a-component.md +178 -0
- package/docs/dev-guides/04-webhook-handlers.md +129 -0
- package/docs/dev-guides/05-testing.md +168 -0
- package/docs/dev-guides/README.md +40 -0
- package/docs/npm-packages-plan.md +288 -0
- package/docs/spine-core--api-reference.md +822 -0
- package/package.json +78 -144
- package/.framework/cli/bin.cjs +0 -14
- package/.framework/cli/commands/init.ts +0 -186
- package/.framework/cli/commands/install-app.ts +0 -565
- package/.framework/cli/commands/migrate.ts +0 -139
- package/.framework/cli/commands/status.ts +0 -197
- package/.framework/cli/commands/uninstall-app.ts +0 -166
- package/.framework/cli/welcome.cjs +0 -45
- package/.framework/docs/STABILITY.md +0 -52
- package/.framework/docs/examples/custom-app/README.md +0 -77
- package/.framework/docs/examples/custom-function/README.md +0 -27
- package/.framework/docs/examples/custom-function/handler.ts +0 -48
- package/.framework/docs/examples/custom-webhook/README.md +0 -68
- package/.framework/migrations/000_foundation.sql +0 -1266
- package/.framework/migrations/001_seed.sql +0 -163
- package/.framework/migrations/002_seed_constraints.sql +0 -19
- package/.framework/migrations/003_auth_user_trigger.sql +0 -67
- package/.framework/src/pages/auth/RegisterPage.tsx +0 -163
- package/STRUCTURE.md +0 -150
- package/bin/spine-framework.cjs +0 -62
- package/bin/welcome.cjs +0 -45
- package/bin/ws-shim.cjs +0 -8
- package/bin/ws-shim.ts +0 -10
- package/config/components.json +0 -25
- package/config/deno.lock +0 -108
- package/config/package-lock.json +0 -17183
- package/config/postcss.config.cjs +0 -10
- package/config/tailwind.config.cjs +0 -78
- package/config/tsconfig.build.json +0 -32
- package/config/tsconfig.cli.json +0 -18
- package/config/tsconfig.json +0 -41
- package/config/tsconfig.node.json +0 -17
- package/config/tsconfig.node.tsbuildinfo +0 -1
- package/config/tsconfig.tsbuildinfo +0 -1
- package/config/typedoc.json +0 -16
- package/config/vite.config.d.ts +0 -2
- package/config/vite.config.ts +0 -72
- package/dist/cli/commands/agents.d.ts +0 -39
- package/dist/cli/commands/agents.d.ts.map +0 -1
- package/dist/cli/commands/auth.d.ts +0 -36
- package/dist/cli/commands/auth.d.ts.map +0 -1
- package/dist/cli/commands/create-app.d.ts +0 -23
- package/dist/cli/commands/create-app.d.ts.map +0 -1
- package/dist/cli/commands/dev.d.ts +0 -24
- package/dist/cli/commands/dev.d.ts.map +0 -1
- package/dist/cli/commands/doctor.d.ts +0 -42
- package/dist/cli/commands/doctor.d.ts.map +0 -1
- package/dist/cli/commands/generate.d.ts +0 -36
- package/dist/cli/commands/generate.d.ts.map +0 -1
- package/dist/cli/commands/init.d.ts +0 -20
- package/dist/cli/commands/init.d.ts.map +0 -1
- package/dist/cli/commands/install-app.d.ts +0 -30
- package/dist/cli/commands/install-app.d.ts.map +0 -1
- package/dist/cli/commands/items.d.ts +0 -45
- package/dist/cli/commands/items.d.ts.map +0 -1
- package/dist/cli/commands/migrate.d.ts +0 -21
- package/dist/cli/commands/migrate.d.ts.map +0 -1
- package/dist/cli/commands/migrations.d.ts +0 -41
- package/dist/cli/commands/migrations.d.ts.map +0 -1
- package/dist/cli/commands/pipelines.d.ts +0 -40
- package/dist/cli/commands/pipelines.d.ts.map +0 -1
- package/dist/cli/commands/status.d.ts +0 -23
- package/dist/cli/commands/status.d.ts.map +0 -1
- package/dist/cli/commands/system.d.ts +0 -29
- package/dist/cli/commands/system.d.ts.map +0 -1
- package/dist/cli/commands/test.d.ts +0 -46
- package/dist/cli/commands/test.d.ts.map +0 -1
- package/dist/cli/commands/uninstall-app.d.ts +0 -23
- package/dist/cli/commands/uninstall-app.d.ts.map +0 -1
- package/dist/cli/context.d.ts +0 -88
- package/dist/cli/context.d.ts.map +0 -1
- package/dist/cli/env-loader.d.ts +0 -14
- package/dist/cli/env-loader.d.ts.map +0 -1
- package/dist/cli/index.d.ts +0 -41
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/functions/_shared/agent-runner.d.ts +0 -156
- package/dist/functions/_shared/agent-runner.d.ts.map +0 -1
- package/dist/functions/_shared/app-manifest.d.ts +0 -68
- package/dist/functions/_shared/app-manifest.d.ts.map +0 -1
- package/dist/functions/_shared/audit.d.ts +0 -91
- package/dist/functions/_shared/audit.d.ts.map +0 -1
- package/dist/functions/_shared/db.d.ts +0 -125
- package/dist/functions/_shared/db.d.ts.map +0 -1
- package/dist/functions/_shared/index.d.ts +0 -299
- package/dist/functions/_shared/index.d.ts.map +0 -1
- package/dist/functions/_shared/middleware.d.ts +0 -315
- package/dist/functions/_shared/middleware.d.ts.map +0 -1
- package/dist/functions/_shared/permissions.d.ts +0 -626
- package/dist/functions/_shared/permissions.d.ts.map +0 -1
- package/dist/functions/_shared/pipeline-runner.d.ts +0 -124
- package/dist/functions/_shared/pipeline-runner.d.ts.map +0 -1
- package/dist/functions/_shared/principal.d.ts +0 -284
- package/dist/functions/_shared/principal.d.ts.map +0 -1
- package/dist/functions/_shared/resolve-ids.d.ts +0 -10
- package/dist/functions/_shared/resolve-ids.d.ts.map +0 -1
- package/dist/functions/_shared/schema-utils.d.ts +0 -181
- package/dist/functions/_shared/schema-utils.d.ts.map +0 -1
- package/dist/functions/_shared/testing.d.ts +0 -172
- package/dist/functions/_shared/testing.d.ts.map +0 -1
- package/dist/functions/_shared/trigger-engine.d.ts +0 -140
- package/dist/functions/_shared/trigger-engine.d.ts.map +0 -1
- package/dist/functions/_shared/webhook-registration.d.ts +0 -81
- package/dist/functions/_shared/webhook-registration.d.ts.map +0 -1
- package/dist/functions/_shared/webhook-registry.d.ts +0 -57
- package/dist/functions/_shared/webhook-registry.d.ts.map +0 -1
- package/dist/functions/account-nodes.d.ts +0 -48
- package/dist/functions/account-nodes.d.ts.map +0 -1
- package/dist/functions/admin-data.d.ts +0 -178
- package/dist/functions/admin-data.d.ts.map +0 -1
- package/dist/functions/ai-agents.d.ts +0 -125
- package/dist/functions/ai-agents.d.ts.map +0 -1
- package/dist/functions/api-keys.d.ts +0 -140
- package/dist/functions/api-keys.d.ts.map +0 -1
- package/dist/functions/apps.d.ts +0 -163
- package/dist/functions/apps.d.ts.map +0 -1
- package/dist/functions/auth.d.ts +0 -74
- package/dist/functions/auth.d.ts.map +0 -1
- package/dist/functions/debug-auth.d.ts +0 -33
- package/dist/functions/debug-auth.d.ts.map +0 -1
- package/dist/functions/embeddings.d.ts +0 -205
- package/dist/functions/embeddings.d.ts.map +0 -1
- package/dist/functions/integration-routes.d.ts +0 -45
- package/dist/functions/integration-routes.d.ts.map +0 -1
- package/dist/functions/integrations.d.ts +0 -124
- package/dist/functions/integrations.d.ts.map +0 -1
- package/dist/functions/item-progress.d.ts +0 -41
- package/dist/functions/item-progress.d.ts.map +0 -1
- package/dist/functions/logs.d.ts +0 -162
- package/dist/functions/logs.d.ts.map +0 -1
- package/dist/functions/observability.d.ts +0 -123
- package/dist/functions/observability.d.ts.map +0 -1
- package/dist/functions/pipeline-executions.d.ts +0 -190
- package/dist/functions/pipeline-executions.d.ts.map +0 -1
- package/dist/functions/pipelines.d.ts +0 -171
- package/dist/functions/pipelines.d.ts.map +0 -1
- package/dist/functions/prompt-configs.d.ts +0 -125
- package/dist/functions/prompt-configs.d.ts.map +0 -1
- package/dist/functions/roles.d.ts +0 -118
- package/dist/functions/roles.d.ts.map +0 -1
- package/dist/functions/system-cron.d.ts +0 -65
- package/dist/functions/system-cron.d.ts.map +0 -1
- package/dist/functions/system.d.ts +0 -29
- package/dist/functions/system.d.ts.map +0 -1
- package/dist/functions/tests.d.ts +0 -28
- package/dist/functions/tests.d.ts.map +0 -1
- package/dist/functions/timers.d.ts +0 -139
- package/dist/functions/timers.d.ts.map +0 -1
- package/dist/functions/triggers.d.ts +0 -203
- package/dist/functions/triggers.d.ts.map +0 -1
- package/dist/functions/types.d.ts +0 -151
- package/dist/functions/types.d.ts.map +0 -1
- package/dist/src/types/types.d.ts +0 -364
- package/dist/src/types/types.d.ts.map +0 -1
- package/index.html +0 -13
- package/netlify.toml +0 -36
- package/package-project.json +0 -64
- package/scripts/ingest-chunks.cjs +0 -202
- package/scripts/kb-chunk-parser.cjs +0 -312
- package/scripts/kb-chunk-parser.ts +0 -330
- package/scripts/load-test-app-install.ts +0 -484
- package/scripts/netlify-dev-wrapper.sh +0 -22
- package/vitest.config.ts +0 -45
- /package/{scripts → .framework/scripts}/app-install-cli.ts +0 -0
- /package/{scripts → .framework/scripts}/boundary-check.sh +0 -0
- /package/{scripts → .framework/scripts}/build-manifest.sh +0 -0
- /package/{scripts → .framework/scripts}/verify-integrity.sh +0 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "funnel_signal_use",
|
|
3
|
+
"kind": "item",
|
|
4
|
+
"name": "Usage Signal",
|
|
5
|
+
"description": "Tracks CLI and app usage signals from npm installations",
|
|
6
|
+
"design_schema": {
|
|
7
|
+
"fields": {
|
|
8
|
+
"title": {
|
|
9
|
+
"data_type": "text",
|
|
10
|
+
"label": "Title",
|
|
11
|
+
"required": true,
|
|
12
|
+
"system": true
|
|
13
|
+
},
|
|
14
|
+
"source": {
|
|
15
|
+
"data_type": "select",
|
|
16
|
+
"label": "Source",
|
|
17
|
+
"required": true,
|
|
18
|
+
"options": ["use"]
|
|
19
|
+
},
|
|
20
|
+
"stage": {
|
|
21
|
+
"data_type": "select",
|
|
22
|
+
"label": "Stage",
|
|
23
|
+
"required": true,
|
|
24
|
+
"options": ["installed", "claimed", "active"]
|
|
25
|
+
},
|
|
26
|
+
"action_type": {
|
|
27
|
+
"data_type": "text",
|
|
28
|
+
"label": "Action Type",
|
|
29
|
+
"required": true
|
|
30
|
+
},
|
|
31
|
+
"action_value": {
|
|
32
|
+
"data_type": "number",
|
|
33
|
+
"label": "Action Value",
|
|
34
|
+
"required": true
|
|
35
|
+
},
|
|
36
|
+
"serial": {
|
|
37
|
+
"data_type": "text",
|
|
38
|
+
"label": "Install Serial",
|
|
39
|
+
"required": true
|
|
40
|
+
},
|
|
41
|
+
"app_slug": {
|
|
42
|
+
"data_type": "select",
|
|
43
|
+
"label": "App",
|
|
44
|
+
"required": false,
|
|
45
|
+
"options": ["framework", "cortex", "portal"]
|
|
46
|
+
},
|
|
47
|
+
"app_version": {
|
|
48
|
+
"data_type": "text",
|
|
49
|
+
"label": "App Version",
|
|
50
|
+
"required": false
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"views": {
|
|
54
|
+
"default_list": {
|
|
55
|
+
"type": "list",
|
|
56
|
+
"display": "table",
|
|
57
|
+
"label": "Usage Signals",
|
|
58
|
+
"fields": {
|
|
59
|
+
"title": { "sortable": true, "display_type": "text" },
|
|
60
|
+
"action_type": { "sortable": true, "display_type": "badge" },
|
|
61
|
+
"stage": { "sortable": true, "display_type": "badge" },
|
|
62
|
+
"serial": { "sortable": true, "display_type": "text" },
|
|
63
|
+
"created_at": { "sortable": true, "display_type": "timestamp" }
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"default_detail": {
|
|
67
|
+
"type": "detail",
|
|
68
|
+
"label": "Signal Detail",
|
|
69
|
+
"sections": [
|
|
70
|
+
{
|
|
71
|
+
"title": "Signal",
|
|
72
|
+
"fields": {
|
|
73
|
+
"action_type": { "display_type": "input" },
|
|
74
|
+
"action_value": { "display_type": "input" },
|
|
75
|
+
"stage": { "display_type": "select" }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"title": "Instance",
|
|
80
|
+
"fields": {
|
|
81
|
+
"serial": { "display_type": "input" },
|
|
82
|
+
"app_slug": { "display_type": "select" },
|
|
83
|
+
"app_version": { "display_type": "input" }
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"record_permissions": {
|
|
90
|
+
"system-admin": ["create", "read", "update", "delete"],
|
|
91
|
+
"support": ["create", "read", "update"],
|
|
92
|
+
"member": ["create", "read"]
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
"validation_schema": {},
|
|
96
|
+
"ownership": "pack",
|
|
97
|
+
"is_active": true
|
|
98
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{
|
|
2
|
+
"slug": "spine_instance",
|
|
3
|
+
"kind": "item",
|
|
4
|
+
"name": "CLI Instance",
|
|
5
|
+
"description": "Tracks npm package installations per device",
|
|
6
|
+
"design_schema": {
|
|
7
|
+
"fields": {
|
|
8
|
+
"title": {
|
|
9
|
+
"data_type": "text",
|
|
10
|
+
"label": "Title",
|
|
11
|
+
"required": true,
|
|
12
|
+
"system": true
|
|
13
|
+
},
|
|
14
|
+
"serial": {
|
|
15
|
+
"data_type": "text",
|
|
16
|
+
"label": "Install Serial",
|
|
17
|
+
"required": true,
|
|
18
|
+
"validation": {
|
|
19
|
+
"pattern": "^sf_inst_[a-z0-9-]+$"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"app_slug": {
|
|
23
|
+
"data_type": "select",
|
|
24
|
+
"label": "App",
|
|
25
|
+
"required": true,
|
|
26
|
+
"options": ["framework", "cortex", "portal"]
|
|
27
|
+
},
|
|
28
|
+
"version": {
|
|
29
|
+
"data_type": "text",
|
|
30
|
+
"label": "Version",
|
|
31
|
+
"required": true
|
|
32
|
+
},
|
|
33
|
+
"claimed_by_person_id": {
|
|
34
|
+
"data_type": "reference",
|
|
35
|
+
"label": "Claimed By",
|
|
36
|
+
"required": false,
|
|
37
|
+
"validation": {
|
|
38
|
+
"reference_kind": "person"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"claimed_at": {
|
|
42
|
+
"data_type": "datetime",
|
|
43
|
+
"label": "Claimed At",
|
|
44
|
+
"required": false
|
|
45
|
+
},
|
|
46
|
+
"first_seen_at": {
|
|
47
|
+
"data_type": "datetime",
|
|
48
|
+
"label": "First Seen",
|
|
49
|
+
"required": true
|
|
50
|
+
},
|
|
51
|
+
"last_signal_at": {
|
|
52
|
+
"data_type": "datetime",
|
|
53
|
+
"label": "Last Signal",
|
|
54
|
+
"required": false
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"views": {
|
|
58
|
+
"default_list": {
|
|
59
|
+
"type": "list",
|
|
60
|
+
"display": "table",
|
|
61
|
+
"label": "CLI Instances",
|
|
62
|
+
"fields": {
|
|
63
|
+
"title": { "sortable": true, "display_type": "text" },
|
|
64
|
+
"app_slug": { "sortable": true, "display_type": "badge" },
|
|
65
|
+
"version": { "sortable": true, "display_type": "text" },
|
|
66
|
+
"claimed_at": { "sortable": true, "display_type": "timestamp" },
|
|
67
|
+
"last_signal_at": { "sortable": true, "display_type": "timestamp" }
|
|
68
|
+
},
|
|
69
|
+
"default_sort": { "field": "created_at", "direction": "desc" }
|
|
70
|
+
},
|
|
71
|
+
"default_detail": {
|
|
72
|
+
"type": "detail",
|
|
73
|
+
"label": "Instance Detail",
|
|
74
|
+
"sections": [
|
|
75
|
+
{
|
|
76
|
+
"title": "Instance",
|
|
77
|
+
"fields": {
|
|
78
|
+
"serial": { "display_type": "input" },
|
|
79
|
+
"app_slug": { "display_type": "select" },
|
|
80
|
+
"version": { "display_type": "input" }
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"title": "Claim",
|
|
85
|
+
"fields": {
|
|
86
|
+
"claimed_by_person_id": { "display_type": "reference_picker" },
|
|
87
|
+
"claimed_at": { "display_type": "timestamp" }
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"title": "Activity",
|
|
92
|
+
"fields": {
|
|
93
|
+
"first_seen_at": { "display_type": "timestamp" },
|
|
94
|
+
"last_signal_at": { "display_type": "timestamp" }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"record_permissions": {
|
|
101
|
+
"system-admin": ["create", "read", "update", "delete"],
|
|
102
|
+
"support": ["create", "read", "update"],
|
|
103
|
+
"member": ["create", "read", "update"]
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"validation_schema": {},
|
|
107
|
+
"ownership": "pack",
|
|
108
|
+
"is_active": true
|
|
109
|
+
}
|
package/.framework/src/App.tsx
CHANGED
|
@@ -3,7 +3,6 @@ import { Routes, Route, Navigate } from 'react-router-dom'
|
|
|
3
3
|
import { useAuth } from './contexts/AuthContext'
|
|
4
4
|
import { LoadingSpinner } from './components/ui/LoadingSpinner'
|
|
5
5
|
import { LoginPage } from './pages/auth/LoginPage'
|
|
6
|
-
import { RegisterPage } from './pages/auth/RegisterPage'
|
|
7
6
|
import { NotFoundPage } from './pages/NotFoundPage'
|
|
8
7
|
import { DashboardPage } from './pages/DashboardPage'
|
|
9
8
|
import { AppWrapper } from './components/AppWrapper'
|
|
@@ -34,7 +33,6 @@ function App() {
|
|
|
34
33
|
{!user ? (
|
|
35
34
|
<Routes>
|
|
36
35
|
<Route path="/login" element={<LoginPage />} />
|
|
37
|
-
<Route path="/register" element={<RegisterPage />} />
|
|
38
36
|
<Route path="*" element={<Navigate to="/login" replace />} />
|
|
39
37
|
</Routes>
|
|
40
38
|
) : (
|
|
@@ -67,11 +65,15 @@ function AuthenticatedRouter() {
|
|
|
67
65
|
return (b.route_prefix?.length || 0) - (a.route_prefix?.length || 0)
|
|
68
66
|
})
|
|
69
67
|
|
|
68
|
+
// Determine default redirect: first app with a route_prefix, or fall back to dashboard
|
|
69
|
+
const defaultApp = sorted.find(app => app.route_prefix && app.route_prefix !== '/')
|
|
70
|
+
const defaultRedirect = defaultApp?.route_prefix || '/dashboard'
|
|
71
|
+
|
|
70
72
|
return (
|
|
71
73
|
<Suspense fallback={<div className="min-h-screen flex items-center justify-center"><LoadingSpinner /></div>}>
|
|
72
74
|
<Routes>
|
|
73
|
-
{/* Default redirect */}
|
|
74
|
-
<Route path="/" element={<Navigate to=
|
|
75
|
+
{/* Default redirect to first available app, or dashboard if no apps */}
|
|
76
|
+
<Route path="/" element={<Navigate to={defaultRedirect} replace />} />
|
|
75
77
|
<Route path="/dashboard" element={<DashboardPage />} />
|
|
76
78
|
|
|
77
79
|
{/* Login route for authenticated users (redirects to qualified app) */}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
-
import { Slot } from "
|
|
3
|
+
import { Slot } from "radix-ui"
|
|
4
4
|
|
|
5
5
|
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
@@ -34,7 +34,7 @@ function Badge({
|
|
|
34
34
|
...props
|
|
35
35
|
}: React.ComponentProps<"span"> &
|
|
36
36
|
VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
|
|
37
|
-
const Comp = asChild ? Slot : "span"
|
|
37
|
+
const Comp = asChild ? Slot.Root : "span"
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
40
|
<Comp
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
|
-
import { Slot } from "
|
|
2
|
+
import { Slot } from "radix-ui"
|
|
3
3
|
|
|
4
4
|
import { cn } from "@/lib/utils"
|
|
5
5
|
import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
|
|
@@ -45,7 +45,7 @@ function BreadcrumbLink({
|
|
|
45
45
|
}: React.ComponentProps<"a"> & {
|
|
46
46
|
asChild?: boolean
|
|
47
47
|
}) {
|
|
48
|
-
const Comp = asChild ? Slot : "a"
|
|
48
|
+
const Comp = asChild ? Slot.Root : "a"
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<Comp
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
2
|
-
import { Slot } from "
|
|
2
|
+
import { Slot } from "radix-ui"
|
|
3
3
|
|
|
4
4
|
import { cn } from "@/lib/utils"
|
|
5
5
|
import { Separator } from "@/components/ui/separator"
|
|
@@ -44,7 +44,7 @@ function ButtonGroupText({
|
|
|
44
44
|
}: React.ComponentProps<"div"> & {
|
|
45
45
|
asChild?: boolean
|
|
46
46
|
}) {
|
|
47
|
-
const Comp = asChild ? Slot : "div"
|
|
47
|
+
const Comp = asChild ? Slot.Root : "div"
|
|
48
48
|
|
|
49
49
|
return (
|
|
50
50
|
<Comp
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
-
import { Slot } from "
|
|
3
|
+
import { Slot } from "radix-ui"
|
|
4
4
|
|
|
5
5
|
import { cn } from "@/lib/utils"
|
|
6
6
|
|
|
@@ -49,7 +49,7 @@ function Button({
|
|
|
49
49
|
VariantProps<typeof buttonVariants> & {
|
|
50
50
|
asChild?: boolean
|
|
51
51
|
}) {
|
|
52
|
-
const Comp = asChild ? Slot : "button"
|
|
52
|
+
const Comp = asChild ? Slot.Root : "button"
|
|
53
53
|
|
|
54
54
|
return (
|
|
55
55
|
<Comp
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
4
|
import * as RechartsPrimitive from "recharts"
|
|
5
|
+
import type { TooltipValueType } from "recharts"
|
|
5
6
|
|
|
6
7
|
import { cn } from "@/lib/utils"
|
|
7
8
|
|
|
@@ -9,6 +10,7 @@ import { cn } from "@/lib/utils"
|
|
|
9
10
|
const THEMES = { light: "", dark: ".dark" } as const
|
|
10
11
|
|
|
11
12
|
const INITIAL_DIMENSION = { width: 320, height: 200 } as const
|
|
13
|
+
type TooltipNameType = number | string
|
|
12
14
|
|
|
13
15
|
export type ChartConfig = Record<
|
|
14
16
|
string,
|
|
@@ -136,7 +138,10 @@ function ChartTooltipContent({
|
|
|
136
138
|
nameKey?: string
|
|
137
139
|
labelKey?: string
|
|
138
140
|
} & Omit<
|
|
139
|
-
RechartsPrimitive.
|
|
141
|
+
RechartsPrimitive.DefaultTooltipContentProps<
|
|
142
|
+
TooltipValueType,
|
|
143
|
+
TooltipNameType
|
|
144
|
+
>,
|
|
140
145
|
"accessibilityLayer"
|
|
141
146
|
>) {
|
|
142
147
|
const { config } = useChart()
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
-
import {
|
|
4
|
+
import { Direction } from "radix-ui"
|
|
5
|
+
|
|
6
|
+
function DirectionProvider({
|
|
7
|
+
dir,
|
|
8
|
+
direction,
|
|
9
|
+
children,
|
|
10
|
+
}: React.ComponentProps<typeof Direction.DirectionProvider> & {
|
|
11
|
+
direction?: React.ComponentProps<typeof Direction.DirectionProvider>["dir"]
|
|
12
|
+
}) {
|
|
13
|
+
return (
|
|
14
|
+
<Direction.DirectionProvider dir={direction ?? dir}>
|
|
15
|
+
{children}
|
|
16
|
+
</Direction.DirectionProvider>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const useDirection = Direction.useDirection
|
|
5
21
|
|
|
6
22
|
export { DirectionProvider, useDirection }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
-
import
|
|
4
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui"
|
|
5
5
|
|
|
6
6
|
import { cn } from "@/lib/utils"
|
|
7
7
|
import { CheckIcon, ChevronRightIcon } from "lucide-react"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
-
import { Slot } from "
|
|
3
|
+
import { Slot } from "radix-ui"
|
|
4
4
|
|
|
5
5
|
import { cn } from "@/lib/utils"
|
|
6
6
|
import { Separator } from "@/components/ui/separator"
|
|
@@ -63,7 +63,7 @@ function Item({
|
|
|
63
63
|
...props
|
|
64
64
|
}: React.ComponentProps<"div"> &
|
|
65
65
|
VariantProps<typeof itemVariants> & { asChild?: boolean }) {
|
|
66
|
-
const Comp = asChild ? Slot : "div"
|
|
66
|
+
const Comp = asChild ? Slot.Root : "div"
|
|
67
67
|
return (
|
|
68
68
|
<Comp
|
|
69
69
|
data-slot="item"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { cva } from "class-variance-authority"
|
|
3
|
-
import
|
|
3
|
+
import { NavigationMenu as NavigationMenuPrimitive } from "radix-ui"
|
|
4
4
|
|
|
5
5
|
import { cn } from "@/lib/utils"
|
|
6
6
|
import { ChevronDownIcon } from "lucide-react"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
-
import
|
|
4
|
+
import { Select as SelectPrimitive } from "radix-ui"
|
|
5
5
|
|
|
6
6
|
import { cn } from "@/lib/utils"
|
|
7
7
|
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
|
-
import { Slot } from "
|
|
3
|
+
import { Slot } from "radix-ui"
|
|
4
4
|
|
|
5
5
|
import { useIsMobile } from "@/hooks/use-mobile"
|
|
6
6
|
import { cn } from "@/lib/utils"
|
|
@@ -398,7 +398,7 @@ function SidebarGroupLabel({
|
|
|
398
398
|
asChild = false,
|
|
399
399
|
...props
|
|
400
400
|
}: React.ComponentProps<"div"> & { asChild?: boolean }) {
|
|
401
|
-
const Comp = asChild ? Slot : "div"
|
|
401
|
+
const Comp = asChild ? Slot.Root : "div"
|
|
402
402
|
|
|
403
403
|
return (
|
|
404
404
|
<Comp
|
|
@@ -418,7 +418,7 @@ function SidebarGroupAction({
|
|
|
418
418
|
asChild = false,
|
|
419
419
|
...props
|
|
420
420
|
}: React.ComponentProps<"button"> & { asChild?: boolean }) {
|
|
421
|
-
const Comp = asChild ? Slot : "button"
|
|
421
|
+
const Comp = asChild ? Slot.Root : "button"
|
|
422
422
|
|
|
423
423
|
return (
|
|
424
424
|
<Comp
|
|
@@ -504,7 +504,7 @@ function SidebarMenuButton({
|
|
|
504
504
|
isActive?: boolean
|
|
505
505
|
tooltip?: string | React.ComponentProps<typeof TooltipContent>
|
|
506
506
|
} & VariantProps<typeof sidebarMenuButtonVariants>) {
|
|
507
|
-
const Comp = asChild ? Slot : "button"
|
|
507
|
+
const Comp = asChild ? Slot.Root : "button"
|
|
508
508
|
const { isMobile, state } = useSidebar()
|
|
509
509
|
|
|
510
510
|
const button = (
|
|
@@ -550,7 +550,7 @@ function SidebarMenuAction({
|
|
|
550
550
|
asChild?: boolean
|
|
551
551
|
showOnHover?: boolean
|
|
552
552
|
}) {
|
|
553
|
-
const Comp = asChild ? Slot : "button"
|
|
553
|
+
const Comp = asChild ? Slot.Root : "button"
|
|
554
554
|
|
|
555
555
|
return (
|
|
556
556
|
<Comp
|
|
@@ -661,7 +661,7 @@ function SidebarMenuSubButton({
|
|
|
661
661
|
size?: "sm" | "md"
|
|
662
662
|
isActive?: boolean
|
|
663
663
|
}) {
|
|
664
|
-
const Comp = asChild ? Slot : "a"
|
|
664
|
+
const Comp = asChild ? Slot.Root : "a"
|
|
665
665
|
|
|
666
666
|
return (
|
|
667
667
|
<Comp
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
4
|
import { type VariantProps } from "class-variance-authority"
|
|
5
|
-
import
|
|
5
|
+
import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui"
|
|
6
6
|
|
|
7
7
|
import { cn } from "@/lib/utils"
|
|
8
8
|
import { toggleVariants } from "@/components/ui/toggle"
|