@nextsparkjs/theme-default 0.1.0-beta.1
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/about/business.md +49 -0
- package/about/features.json +302 -0
- package/about/team.md +79 -0
- package/api/ai/chat/stream/route.ts +212 -0
- package/api/ai/orchestrator/route.ts +226 -0
- package/api/ai/single-agent/route.ts +291 -0
- package/api/ai/usage/route.ts +122 -0
- package/blocks/benefits/component.tsx +100 -0
- package/blocks/benefits/config.ts +11 -0
- package/blocks/benefits/examples.ts +85 -0
- package/blocks/benefits/fields.ts +156 -0
- package/blocks/benefits/schema.ts +33 -0
- package/blocks/cta-section/component.tsx +100 -0
- package/blocks/cta-section/config.ts +11 -0
- package/blocks/cta-section/examples.ts +41 -0
- package/blocks/cta-section/fields.ts +89 -0
- package/blocks/cta-section/index.ts +6 -0
- package/blocks/cta-section/schema.ts +32 -0
- package/blocks/cta-section/thumbnail.png +1 -0
- package/blocks/faq-accordion/component.tsx +156 -0
- package/blocks/faq-accordion/config.ts +11 -0
- package/blocks/faq-accordion/examples.ts +77 -0
- package/blocks/faq-accordion/fields.ts +119 -0
- package/blocks/faq-accordion/index.ts +6 -0
- package/blocks/faq-accordion/schema.ts +45 -0
- package/blocks/features-grid/component.tsx +112 -0
- package/blocks/features-grid/config.ts +11 -0
- package/blocks/features-grid/examples.ts +63 -0
- package/blocks/features-grid/fields.ts +97 -0
- package/blocks/features-grid/index.ts +6 -0
- package/blocks/features-grid/schema.ts +40 -0
- package/blocks/features-grid/thumbnail.png +1 -0
- package/blocks/hero/component.tsx +100 -0
- package/blocks/hero/config.ts +11 -0
- package/blocks/hero/examples.ts +35 -0
- package/blocks/hero/fields.ts +60 -0
- package/blocks/hero/index.ts +6 -0
- package/blocks/hero/schema.ts +32 -0
- package/blocks/hero/thumbnail.png +1 -0
- package/blocks/hero/thumbnail.png.txt +6 -0
- package/blocks/hero-with-form/component.tsx +232 -0
- package/blocks/hero-with-form/config.ts +11 -0
- package/blocks/hero-with-form/examples.ts +16 -0
- package/blocks/hero-with-form/fields.ts +207 -0
- package/blocks/hero-with-form/index.ts +6 -0
- package/blocks/hero-with-form/schema.ts +54 -0
- package/blocks/jumbotron/component.tsx +136 -0
- package/blocks/jumbotron/config.ts +11 -0
- package/blocks/jumbotron/examples.ts +36 -0
- package/blocks/jumbotron/fields.ts +202 -0
- package/blocks/jumbotron/index.ts +6 -0
- package/blocks/jumbotron/schema.ts +55 -0
- package/blocks/logo-cloud/component.tsx +154 -0
- package/blocks/logo-cloud/config.ts +11 -0
- package/blocks/logo-cloud/examples.ts +34 -0
- package/blocks/logo-cloud/fields.ts +133 -0
- package/blocks/logo-cloud/index.ts +6 -0
- package/blocks/logo-cloud/schema.ts +46 -0
- package/blocks/post-content/component.tsx +197 -0
- package/blocks/post-content/config.ts +11 -0
- package/blocks/post-content/examples.ts +33 -0
- package/blocks/post-content/fields.ts +165 -0
- package/blocks/post-content/index.ts +4 -0
- package/blocks/post-content/schema.ts +46 -0
- package/blocks/pricing-table/component.tsx +154 -0
- package/blocks/pricing-table/config.ts +11 -0
- package/blocks/pricing-table/examples.ts +96 -0
- package/blocks/pricing-table/fields.ts +161 -0
- package/blocks/pricing-table/index.ts +4 -0
- package/blocks/pricing-table/schema.ts +50 -0
- package/blocks/split-content/component.tsx +135 -0
- package/blocks/split-content/config.ts +11 -0
- package/blocks/split-content/examples.ts +38 -0
- package/blocks/split-content/fields.ts +198 -0
- package/blocks/split-content/index.ts +6 -0
- package/blocks/split-content/schema.ts +67 -0
- package/blocks/stats-counter/component.tsx +124 -0
- package/blocks/stats-counter/config.ts +11 -0
- package/blocks/stats-counter/examples.ts +61 -0
- package/blocks/stats-counter/fields.ts +134 -0
- package/blocks/stats-counter/index.ts +6 -0
- package/blocks/stats-counter/schema.ts +47 -0
- package/blocks/testimonials/component.tsx +114 -0
- package/blocks/testimonials/config.ts +11 -0
- package/blocks/testimonials/examples.ts +65 -0
- package/blocks/testimonials/fields.ts +105 -0
- package/blocks/testimonials/index.ts +6 -0
- package/blocks/testimonials/schema.ts +41 -0
- package/blocks/testimonials/thumbnail.png +1 -0
- package/blocks/text-content/component.tsx +97 -0
- package/blocks/text-content/config.ts +11 -0
- package/blocks/text-content/examples.ts +30 -0
- package/blocks/text-content/fields.ts +88 -0
- package/blocks/text-content/index.ts +6 -0
- package/blocks/text-content/schema.ts +30 -0
- package/blocks/text-content/thumbnail.png +1 -0
- package/blocks/timeline/component.tsx +267 -0
- package/blocks/timeline/config.ts +11 -0
- package/blocks/timeline/examples.ts +68 -0
- package/blocks/timeline/fields.ts +147 -0
- package/blocks/timeline/index.ts +6 -0
- package/blocks/timeline/schema.ts +49 -0
- package/blocks/video-hero/component.tsx +270 -0
- package/blocks/video-hero/config.ts +11 -0
- package/blocks/video-hero/examples.ts +24 -0
- package/blocks/video-hero/fields.ts +98 -0
- package/blocks/video-hero/index.ts +6 -0
- package/blocks/video-hero/schema.ts +39 -0
- package/components/ai-chat/ChatPanel.tsx +575 -0
- package/components/ai-chat/ConversationItem.tsx +266 -0
- package/components/ai-chat/ConversationSidebar.tsx +99 -0
- package/components/ai-chat/MarkdownRenderer.tsx +15 -0
- package/components/ai-chat/Message.tsx +42 -0
- package/components/ai-chat/MessageInput.tsx +49 -0
- package/components/ai-chat/MessageList.tsx +46 -0
- package/components/ai-chat/TypingIndicator.tsx +11 -0
- package/config/app.config.ts +367 -0
- package/config/billing.config.ts +349 -0
- package/config/dashboard.config.ts +506 -0
- package/config/dev.config.ts +104 -0
- package/config/features.config.ts +203 -0
- package/config/flows.config.ts +129 -0
- package/config/permissions.config.ts +245 -0
- package/config/theme.config.ts +74 -0
- package/docs/01-overview/01-introduction.md +335 -0
- package/docs/01-overview/02-customization.md +671 -0
- package/docs/02-features/01-components.md +155 -0
- package/docs/02-features/02-styling.md +139 -0
- package/docs/02-features/03-tasks-entity.md +407 -0
- package/docs/03-ai/01-overview.md +211 -0
- package/docs/03-ai/02-customization.md +436 -0
- package/entities/customers/customers.config.ts +75 -0
- package/entities/customers/customers.fields.ts +165 -0
- package/entities/customers/customers.service.ts +516 -0
- package/entities/customers/customers.types.ts +83 -0
- package/entities/customers/messages/en.json +66 -0
- package/entities/customers/messages/es.json +66 -0
- package/entities/customers/migrations/001_customers_table.sql +102 -0
- package/entities/customers/migrations/002_customers_metas.sql +92 -0
- package/entities/pages/messages/en.json +41 -0
- package/entities/pages/messages/es.json +41 -0
- package/entities/pages/migrations/001_pages_table.sql +112 -0
- package/entities/pages/migrations/002_pages_metas.sql +56 -0
- package/entities/pages/migrations/003_add_status.sql +50 -0
- package/entities/pages/pages-management.service.ts +610 -0
- package/entities/pages/pages.config.ts +94 -0
- package/entities/pages/pages.fields.ts +101 -0
- package/entities/pages/pages.service.ts +290 -0
- package/entities/pages/pages.types.ts +124 -0
- package/entities/posts/components/post-header.tsx +97 -0
- package/entities/posts/messages/en.json +55 -0
- package/entities/posts/messages/es.json +55 -0
- package/entities/posts/migrations/001_posts_table.sql +115 -0
- package/entities/posts/migrations/003_add_status.sql +44 -0
- package/entities/posts/migrations/004_entity_taxonomy_relations.sql +129 -0
- package/entities/posts/migrations/006_posts_metas.sql +56 -0
- package/entities/posts/posts.config.ts +101 -0
- package/entities/posts/posts.fields.ts +116 -0
- package/entities/posts/posts.service.ts +376 -0
- package/entities/posts/posts.types.ts +74 -0
- package/entities/tasks/messages/en.json +204 -0
- package/entities/tasks/messages/es.json +204 -0
- package/entities/tasks/migrations/001_tasks_table.sql +105 -0
- package/entities/tasks/migrations/002_task_metas.sql +85 -0
- package/entities/tasks/migrations/sample_data.json +77 -0
- package/entities/tasks/tasks.config.ts +79 -0
- package/entities/tasks/tasks.fields.ts +196 -0
- package/entities/tasks/tasks.service.ts +541 -0
- package/entities/tasks/tasks.types.ts +56 -0
- package/lib/hooks/useAiChat.ts +114 -0
- package/lib/hooks/useConversations.ts +376 -0
- package/lib/hooks/useOrchestratorChat.ts +122 -0
- package/lib/hooks/usePersistentChat.ts +315 -0
- package/lib/hooks/useStreamingChat.ts +127 -0
- package/lib/hooks/useTokenUsage.ts +63 -0
- package/lib/langchain/agents/customer-assistant.md +69 -0
- package/lib/langchain/agents/index.ts +61 -0
- package/lib/langchain/agents/orchestrator.md +59 -0
- package/lib/langchain/agents/page-assistant.md +85 -0
- package/lib/langchain/agents/single-agent.md +46 -0
- package/lib/langchain/agents/task-assistant.md +55 -0
- package/lib/langchain/config.ts +45 -0
- package/lib/langchain/handlers/customer-handler.ts +338 -0
- package/lib/langchain/handlers/page-handler.ts +232 -0
- package/lib/langchain/handlers/task-handler.ts +323 -0
- package/lib/langchain/langchain.config.ts +223 -0
- package/lib/langchain/observability.config.ts +30 -0
- package/lib/langchain/orchestrator.ts +562 -0
- package/lib/langchain/tools/customers.ts +176 -0
- package/lib/langchain/tools/index.ts +10 -0
- package/lib/langchain/tools/orchestrator.ts +92 -0
- package/lib/langchain/tools/pages.ts +289 -0
- package/lib/langchain/tools/tasks.ts +167 -0
- package/lib/scheduled-actions/billing.ts +149 -0
- package/lib/scheduled-actions/index.ts +170 -0
- package/lib/scheduled-actions/webhook.ts +231 -0
- package/lib/selectors.ts +197 -0
- package/messages/de/admin.json +219 -0
- package/messages/de/aiUsage.json +36 -0
- package/messages/de/buttons.json +19 -0
- package/messages/de/categories.json +35 -0
- package/messages/de/common.json +16 -0
- package/messages/de/dev.json +101 -0
- package/messages/de/docs.json +27 -0
- package/messages/de/entities.json +7 -0
- package/messages/de/features.json +119 -0
- package/messages/de/footer.json +22 -0
- package/messages/de/home.json +57 -0
- package/messages/de/index.ts +39 -0
- package/messages/de/mobileNav.json +13 -0
- package/messages/de/navigation.json +8 -0
- package/messages/de/observability.json +74 -0
- package/messages/de/posts.json +54 -0
- package/messages/de/pricing.json +102 -0
- package/messages/de/support.json +9 -0
- package/messages/de/teams.json +8 -0
- package/messages/en/admin.json +219 -0
- package/messages/en/aiUsage.json +36 -0
- package/messages/en/buttons.json +19 -0
- package/messages/en/categories.json +35 -0
- package/messages/en/common.json +16 -0
- package/messages/en/dev.json +106 -0
- package/messages/en/docs.json +27 -0
- package/messages/en/entities.json +7 -0
- package/messages/en/features.json +119 -0
- package/messages/en/footer.json +22 -0
- package/messages/en/home.json +57 -0
- package/messages/en/index.ts +39 -0
- package/messages/en/mobileNav.json +13 -0
- package/messages/en/navigation.json +8 -0
- package/messages/en/observability.json +74 -0
- package/messages/en/posts.json +54 -0
- package/messages/en/pricing.json +102 -0
- package/messages/en/support.json +9 -0
- package/messages/en/teams.json +8 -0
- package/messages/es/admin.json +219 -0
- package/messages/es/aiUsage.json +36 -0
- package/messages/es/buttons.json +19 -0
- package/messages/es/categories.json +35 -0
- package/messages/es/common.json +16 -0
- package/messages/es/dev.json +101 -0
- package/messages/es/docs.json +27 -0
- package/messages/es/entities.json +7 -0
- package/messages/es/features.json +119 -0
- package/messages/es/footer.json +22 -0
- package/messages/es/home.json +57 -0
- package/messages/es/index.ts +39 -0
- package/messages/es/mobileNav.json +13 -0
- package/messages/es/navigation.json +8 -0
- package/messages/es/observability.json +74 -0
- package/messages/es/posts.json +54 -0
- package/messages/es/pricing.json +102 -0
- package/messages/es/support.json +9 -0
- package/messages/es/teams.json +8 -0
- package/messages/fr/admin.json +219 -0
- package/messages/fr/aiUsage.json +36 -0
- package/messages/fr/buttons.json +19 -0
- package/messages/fr/categories.json +35 -0
- package/messages/fr/common.json +16 -0
- package/messages/fr/dev.json +101 -0
- package/messages/fr/docs.json +27 -0
- package/messages/fr/entities.json +7 -0
- package/messages/fr/features.json +119 -0
- package/messages/fr/footer.json +22 -0
- package/messages/fr/home.json +57 -0
- package/messages/fr/index.ts +39 -0
- package/messages/fr/mobileNav.json +13 -0
- package/messages/fr/navigation.json +8 -0
- package/messages/fr/observability.json +74 -0
- package/messages/fr/posts.json +54 -0
- package/messages/fr/pricing.json +102 -0
- package/messages/fr/support.json +9 -0
- package/messages/fr/teams.json +8 -0
- package/messages/it/admin.json +219 -0
- package/messages/it/aiUsage.json +36 -0
- package/messages/it/buttons.json +19 -0
- package/messages/it/categories.json +35 -0
- package/messages/it/common.json +16 -0
- package/messages/it/dev.json +101 -0
- package/messages/it/docs.json +27 -0
- package/messages/it/entities.json +7 -0
- package/messages/it/features.json +119 -0
- package/messages/it/footer.json +22 -0
- package/messages/it/home.json +57 -0
- package/messages/it/index.ts +39 -0
- package/messages/it/mobileNav.json +13 -0
- package/messages/it/navigation.json +8 -0
- package/messages/it/observability.json +74 -0
- package/messages/it/posts.json +54 -0
- package/messages/it/pricing.json +102 -0
- package/messages/it/support.json +9 -0
- package/messages/it/teams.json +8 -0
- package/messages/pt/admin.json +219 -0
- package/messages/pt/aiUsage.json +36 -0
- package/messages/pt/buttons.json +19 -0
- package/messages/pt/categories.json +35 -0
- package/messages/pt/common.json +16 -0
- package/messages/pt/dev.json +101 -0
- package/messages/pt/docs.json +27 -0
- package/messages/pt/entities.json +7 -0
- package/messages/pt/features.json +119 -0
- package/messages/pt/footer.json +22 -0
- package/messages/pt/home.json +57 -0
- package/messages/pt/index.ts +39 -0
- package/messages/pt/mobileNav.json +13 -0
- package/messages/pt/navigation.json +8 -0
- package/messages/pt/observability.json +74 -0
- package/messages/pt/posts.json +54 -0
- package/messages/pt/pricing.json +102 -0
- package/messages/pt/support.json +9 -0
- package/messages/pt/teams.json +8 -0
- package/migrations/089_add_editor_team_role.sql +39 -0
- package/migrations/090_demo_users_teams.sql +540 -0
- package/migrations/091_greek_teams_billing.sql +523 -0
- package/migrations/092_billing_sample_data.sql +774 -0
- package/migrations/093_pages_sample_data.sql +1158 -0
- package/migrations/094_posts_sample_data.sql +278 -0
- package/migrations/095_tasks_sample_data.sql +440 -0
- package/migrations/096_customers_sample_data.sql +358 -0
- package/migrations/097_scheduled_actions_sample_data.sql +111 -0
- package/package.json +22 -0
- package/public/docs/desktop-layout-example.png +0 -0
- package/styles/components.css +11 -0
- package/styles/globals.css +179 -0
- package/templates/(public)/blog/[slug]/page.tsx +65 -0
- package/templates/(public)/layout.tsx +25 -0
- package/templates/(public)/page.tsx +200 -0
- package/templates/(public)/support/page.tsx +321 -0
- package/templates/dashboard/(main)/agent-multi/page.tsx +63 -0
- package/templates/dashboard/(main)/agent-single/page.tsx +142 -0
- package/templates/dashboard/(main)/settings/ai-usage/page.tsx +157 -0
- package/templates/superadmin/ai-observability/[traceId]/page.tsx +27 -0
- package/templates/superadmin/ai-observability/page.tsx +17 -0
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* boilerplate Theme- Application Configuration Overrides
|
|
3
|
+
*
|
|
4
|
+
* This file allows the theme to override core application configuration values.
|
|
5
|
+
* Only include properties you want to override - missing properties will use core defaults.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Partial configuration type - all properties are optional
|
|
9
|
+
export const APP_CONFIG_OVERRIDES = {
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// APPLICATION METADATA OVERRIDES
|
|
12
|
+
// =============================================================================
|
|
13
|
+
app: {
|
|
14
|
+
name: 'Boilerplate',
|
|
15
|
+
version: '1.0.0',
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
// =============================================================================
|
|
19
|
+
// TEAMS CONFIGURATION - MULTI-TENANT MODE
|
|
20
|
+
// =============================================================================
|
|
21
|
+
/**
|
|
22
|
+
* Multi-tenant mode:
|
|
23
|
+
* - Multiple work teams (workspaces)
|
|
24
|
+
* - Team switching enabled
|
|
25
|
+
* - Invitations enabled
|
|
26
|
+
* - Can create new teams
|
|
27
|
+
*/
|
|
28
|
+
teams: {
|
|
29
|
+
mode: 'multi-tenant' as const,
|
|
30
|
+
options: {
|
|
31
|
+
maxMembersPerTeam: 50,
|
|
32
|
+
allowLeaveTeam: true,
|
|
33
|
+
allowCreateTeams: true,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
// =============================================================================
|
|
38
|
+
// INTERNATIONALIZATION OVERRIDES
|
|
39
|
+
// =============================================================================
|
|
40
|
+
i18n: {
|
|
41
|
+
/**
|
|
42
|
+
* Supported locales for your project
|
|
43
|
+
* Add/remove locales as needed
|
|
44
|
+
*/
|
|
45
|
+
supportedLocales: ['en', 'es'],
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Default locale for your project
|
|
49
|
+
* Override to change the primary language
|
|
50
|
+
*/
|
|
51
|
+
defaultLocale: 'es' as const,
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Additional namespaces specific to Boilerplate
|
|
55
|
+
*/
|
|
56
|
+
namespaces: [
|
|
57
|
+
'common',
|
|
58
|
+
'dashboard',
|
|
59
|
+
'settings',
|
|
60
|
+
'auth',
|
|
61
|
+
'public',
|
|
62
|
+
'validation',
|
|
63
|
+
|
|
64
|
+
// Project specific
|
|
65
|
+
'tasks',
|
|
66
|
+
'clients',
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
// =============================================================================
|
|
71
|
+
// API CONFIGURATION OVERRIDES
|
|
72
|
+
// =============================================================================
|
|
73
|
+
api: {
|
|
74
|
+
cors: {
|
|
75
|
+
allowedOrigins: {
|
|
76
|
+
development: [
|
|
77
|
+
'http://localhost:3000',
|
|
78
|
+
'http://localhost:5173',
|
|
79
|
+
'http://127.0.0.1:3000',
|
|
80
|
+
'http://127.0.0.1:5173',
|
|
81
|
+
// Project specific development origins
|
|
82
|
+
],
|
|
83
|
+
production: [
|
|
84
|
+
// Add Project production domains
|
|
85
|
+
// 'https://boilerplate-themoneyteam.xyz',
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
// =============================================================================
|
|
92
|
+
// DOCUMENTATION CONFIGURATION
|
|
93
|
+
// =============================================================================
|
|
94
|
+
docs: {
|
|
95
|
+
/**
|
|
96
|
+
* Enable/disable documentation system
|
|
97
|
+
*/
|
|
98
|
+
enabled: true,
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Public access to documentation
|
|
102
|
+
* - true: Documentation accessible without authentication
|
|
103
|
+
* - false: Requires user to be logged in
|
|
104
|
+
*/
|
|
105
|
+
public: true,
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Enable search functionality in documentation
|
|
109
|
+
*/
|
|
110
|
+
searchEnabled: true,
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Show breadcrumbs in documentation pages
|
|
114
|
+
*/
|
|
115
|
+
breadcrumbs: true,
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Theme Documentation Configuration
|
|
119
|
+
* Controls how theme-level documentation appears in the sidebar
|
|
120
|
+
*/
|
|
121
|
+
theme: {
|
|
122
|
+
/** Show/hide theme documentation category */
|
|
123
|
+
enabled: true,
|
|
124
|
+
/** Expand theme category by default on page load */
|
|
125
|
+
open: true,
|
|
126
|
+
/** Custom label displayed in sidebar for theme category */
|
|
127
|
+
label: "Default Theme",
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Plugins Documentation Configuration
|
|
132
|
+
* Controls how plugin documentation appears in the sidebar
|
|
133
|
+
*/
|
|
134
|
+
plugins: {
|
|
135
|
+
/** Show/hide plugin documentation category */
|
|
136
|
+
enabled: true,
|
|
137
|
+
/** Expand plugins category by default on page load */
|
|
138
|
+
open: false,
|
|
139
|
+
/** Custom label displayed in sidebar for plugins category */
|
|
140
|
+
label: "Plugins",
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Core Documentation Configuration
|
|
145
|
+
* Controls how core framework documentation appears in the sidebar
|
|
146
|
+
*/
|
|
147
|
+
core: {
|
|
148
|
+
/** Show/hide core documentation category */
|
|
149
|
+
enabled: true,
|
|
150
|
+
/** Expand core category by default on page load */
|
|
151
|
+
open: true,
|
|
152
|
+
/** Custom label displayed in sidebar for core category */
|
|
153
|
+
label: "Core",
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Additional environment-based check for plugin docs in production
|
|
158
|
+
* Plugin docs will only show if BOTH conditions are met:
|
|
159
|
+
* 1. plugins.enabled is true
|
|
160
|
+
* 2. Either in development OR showPluginsDocsInProd is true
|
|
161
|
+
*
|
|
162
|
+
* @deprecated Prefer using plugins.enabled for simpler control
|
|
163
|
+
* By default plugins documentation is not available in prod environments
|
|
164
|
+
*/
|
|
165
|
+
showPluginsDocsInProd: false,
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
// =============================================================================
|
|
169
|
+
// TEAM ROLES - NOW IN permissions.config.ts
|
|
170
|
+
// =============================================================================
|
|
171
|
+
// Team roles (additionalRoles, hierarchy, displayNames, descriptions) are now
|
|
172
|
+
// defined in permissions.config.ts under the `roles` section.
|
|
173
|
+
// This is the SINGLE SOURCE OF TRUTH for all permissions and roles.
|
|
174
|
+
//
|
|
175
|
+
// See: contents/themes/default/config/permissions.config.ts
|
|
176
|
+
//
|
|
177
|
+
// To add custom roles, edit permissions.config.ts:
|
|
178
|
+
// ```
|
|
179
|
+
// roles: {
|
|
180
|
+
// additionalRoles: ['editor'],
|
|
181
|
+
// hierarchy: { editor: 5 },
|
|
182
|
+
// displayNames: { editor: 'common.teamRoles.editor' },
|
|
183
|
+
// descriptions: { editor: 'Can view team content...' },
|
|
184
|
+
// },
|
|
185
|
+
// ```
|
|
186
|
+
|
|
187
|
+
// =============================================================================
|
|
188
|
+
// USER ROLES EXTENSION
|
|
189
|
+
// =============================================================================
|
|
190
|
+
// User roles (member, superadmin, developer) are system-level roles.
|
|
191
|
+
// For team roles configuration, see permissions.config.ts
|
|
192
|
+
//
|
|
193
|
+
// Uncomment to extend user roles:
|
|
194
|
+
// userRoles: {
|
|
195
|
+
// additionalRoles: ['moderator'] as const,
|
|
196
|
+
// hierarchy: { moderator: 50 },
|
|
197
|
+
// displayNames: { moderator: 'common.userRoles.moderator' },
|
|
198
|
+
// descriptions: { moderator: 'Can moderate content' },
|
|
199
|
+
// },
|
|
200
|
+
|
|
201
|
+
// =============================================================================
|
|
202
|
+
// MOBILE NAVIGATION OVERRIDES
|
|
203
|
+
// =============================================================================
|
|
204
|
+
// Uncomment and modify to customize mobile navigation items
|
|
205
|
+
// You can add/remove/reorder items, change icons, or disable items
|
|
206
|
+
//
|
|
207
|
+
mobileNav: {
|
|
208
|
+
/**
|
|
209
|
+
* Mobile bottom navigation items
|
|
210
|
+
* Configure which items appear in the mobile navigation bar
|
|
211
|
+
*
|
|
212
|
+
* Icon names use lucide-react icons (https://lucide.dev)
|
|
213
|
+
* Set isCentral: true for the highlighted center button (only one should have this)
|
|
214
|
+
*/
|
|
215
|
+
items: [
|
|
216
|
+
{
|
|
217
|
+
id: 'home',
|
|
218
|
+
labelKey: 'common.mobileNav.home',
|
|
219
|
+
href: '/dashboard',
|
|
220
|
+
icon: 'Home',
|
|
221
|
+
enabled: true,
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: 'tasks',
|
|
225
|
+
labelKey: 'common.mobileNav.tasks',
|
|
226
|
+
href: '/dashboard/tasks',
|
|
227
|
+
icon: 'CheckSquare',
|
|
228
|
+
enabled: true,
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: 'create',
|
|
232
|
+
labelKey: 'common.mobileNav.create',
|
|
233
|
+
icon: 'Plus',
|
|
234
|
+
isCentral: true,
|
|
235
|
+
action: 'quickCreate',
|
|
236
|
+
enabled: true,
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
id: 'settings',
|
|
240
|
+
labelKey: 'common.mobileNav.settings',
|
|
241
|
+
href: '/dashboard/settings',
|
|
242
|
+
icon: 'Settings',
|
|
243
|
+
enabled: true,
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
id: 'more',
|
|
247
|
+
labelKey: 'common.mobileNav.more',
|
|
248
|
+
icon: 'Menu',
|
|
249
|
+
action: 'moreSheet',
|
|
250
|
+
enabled: true,
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* More Sheet items
|
|
256
|
+
* Configure which items appear in the "More" sheet
|
|
257
|
+
*
|
|
258
|
+
* These are secondary navigation items that appear when the user taps "More"
|
|
259
|
+
* Typical use: Settings subpages, help, support, profile, etc.
|
|
260
|
+
*/
|
|
261
|
+
moreSheetItems: [
|
|
262
|
+
{
|
|
263
|
+
id: 'profile',
|
|
264
|
+
labelKey: 'common.navigation.profile',
|
|
265
|
+
href: '/dashboard/settings/profile',
|
|
266
|
+
icon: 'User',
|
|
267
|
+
enabled: true,
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
id: 'billing',
|
|
271
|
+
labelKey: 'common.navigation.billing',
|
|
272
|
+
href: '/dashboard/settings/billing',
|
|
273
|
+
icon: 'CreditCard',
|
|
274
|
+
enabled: true,
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
id: 'api-keys',
|
|
278
|
+
labelKey: 'common.navigation.apiKeys',
|
|
279
|
+
href: '/dashboard/settings/api-keys',
|
|
280
|
+
icon: 'Key',
|
|
281
|
+
enabled: true,
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
id: 'help',
|
|
285
|
+
labelKey: 'common.navigation.help',
|
|
286
|
+
href: '/support',
|
|
287
|
+
icon: 'HelpCircle',
|
|
288
|
+
enabled: false,
|
|
289
|
+
external: true,
|
|
290
|
+
},
|
|
291
|
+
],
|
|
292
|
+
},
|
|
293
|
+
|
|
294
|
+
// =============================================================================
|
|
295
|
+
// SCHEDULED ACTIONS CONFIGURATION
|
|
296
|
+
// =============================================================================
|
|
297
|
+
/**
|
|
298
|
+
* Scheduled Actions System
|
|
299
|
+
* Background task processing via external cron
|
|
300
|
+
*/
|
|
301
|
+
scheduledActions: {
|
|
302
|
+
/** Enable/disable scheduled actions system */
|
|
303
|
+
enabled: true,
|
|
304
|
+
|
|
305
|
+
/** Retention period for completed/failed actions (days) */
|
|
306
|
+
retentionDays: 7,
|
|
307
|
+
|
|
308
|
+
/** Maximum number of actions to process per cron run */
|
|
309
|
+
batchSize: 10,
|
|
310
|
+
|
|
311
|
+
/** Default timeout per action (milliseconds) */
|
|
312
|
+
defaultTimeout: 30000,
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Multi-endpoint Webhook Configuration
|
|
316
|
+
*
|
|
317
|
+
* Each webhook endpoint is identified by a key and reads its URL from an env variable.
|
|
318
|
+
* Webhooks can auto-match by event pattern or be explicitly called by key.
|
|
319
|
+
*/
|
|
320
|
+
webhooks: {
|
|
321
|
+
endpoints: {
|
|
322
|
+
// Default catch-all webhook (disabled by default)
|
|
323
|
+
default: {
|
|
324
|
+
envVar: 'WEBHOOK_URL_DEFAULT',
|
|
325
|
+
description: 'Default webhook for general notifications',
|
|
326
|
+
patterns: ['*:*'],
|
|
327
|
+
enabled: false,
|
|
328
|
+
},
|
|
329
|
+
// Task lifecycle webhook
|
|
330
|
+
tasks: {
|
|
331
|
+
envVar: 'WEBHOOK_URL_TASKS',
|
|
332
|
+
description: 'Task create/update/delete notifications',
|
|
333
|
+
patterns: ['task:created', 'task:updated', 'task:deleted'],
|
|
334
|
+
enabled: true,
|
|
335
|
+
},
|
|
336
|
+
// Subscription lifecycle webhook
|
|
337
|
+
subscriptions: {
|
|
338
|
+
envVar: 'WEBHOOK_URL_SUBSCRIPTIONS',
|
|
339
|
+
description: 'Subscription lifecycle notifications (create, update, cancel, renewal, expiring)',
|
|
340
|
+
patterns: ['subscription:created', 'subscription:updated', 'subscription:renewed', 'subscription:cancelled', 'subscription:expiring_soon'],
|
|
341
|
+
enabled: true,
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
defaultEndpoint: 'default',
|
|
345
|
+
},
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Deduplication Settings
|
|
349
|
+
*
|
|
350
|
+
* Prevents duplicate scheduled actions within a time window.
|
|
351
|
+
* Behavior:
|
|
352
|
+
* - windowSeconds > 0: Updates existing action's payload (always keeps latest)
|
|
353
|
+
* - windowSeconds = 0: Disables deduplication (track all changes)
|
|
354
|
+
*/
|
|
355
|
+
deduplication: {
|
|
356
|
+
/** Time window in seconds (same entityId within window = duplicate). Set to 0 to disable. */
|
|
357
|
+
windowSeconds: 30,
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
|
|
361
|
+
// =============================================================================
|
|
362
|
+
// DEV KEYRING - MOVED TO dev.config.ts
|
|
363
|
+
// =============================================================================
|
|
364
|
+
// DevKeyring configuration has been moved to dev.config.ts
|
|
365
|
+
// This separates development-only settings from production configuration.
|
|
366
|
+
// See: contents/themes/default/config/dev.config.ts
|
|
367
|
+
}
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Billing Configuration - Default Theme
|
|
3
|
+
*
|
|
4
|
+
* Defines plans, features, limits, and action mappings for the default theme.
|
|
5
|
+
* This configuration is used by BILLING_REGISTRY with pre-computed matrices
|
|
6
|
+
* for O(1) runtime lookups.
|
|
7
|
+
*
|
|
8
|
+
* The three-layer model:
|
|
9
|
+
* RESULT = Permission (RBAC) AND Feature (Plan) AND Quota (Limits)
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import type { BillingConfig } from '@nextsparkjs/core/lib/billing/config-types'
|
|
13
|
+
|
|
14
|
+
export const billingConfig: BillingConfig = {
|
|
15
|
+
provider: 'stripe',
|
|
16
|
+
currency: 'usd',
|
|
17
|
+
defaultPlan: 'free',
|
|
18
|
+
|
|
19
|
+
// ===========================================
|
|
20
|
+
// FEATURE DEFINITIONS
|
|
21
|
+
// ===========================================
|
|
22
|
+
features: {
|
|
23
|
+
// Analytics features
|
|
24
|
+
basic_analytics: {
|
|
25
|
+
name: 'billing.features.basic_analytics',
|
|
26
|
+
description: 'billing.features.basic_analytics_description',
|
|
27
|
+
},
|
|
28
|
+
advanced_analytics: {
|
|
29
|
+
name: 'billing.features.advanced_analytics',
|
|
30
|
+
description: 'billing.features.advanced_analytics_description',
|
|
31
|
+
},
|
|
32
|
+
realtime_analytics: {
|
|
33
|
+
name: 'billing.features.realtime_analytics',
|
|
34
|
+
description: 'billing.features.realtime_analytics_description',
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
// API features
|
|
38
|
+
api_access: {
|
|
39
|
+
name: 'billing.features.api_access',
|
|
40
|
+
description: 'billing.features.api_access_description',
|
|
41
|
+
},
|
|
42
|
+
webhooks: {
|
|
43
|
+
name: 'billing.features.webhooks',
|
|
44
|
+
description: 'billing.features.webhooks_description',
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
// Customization features
|
|
48
|
+
custom_branding: {
|
|
49
|
+
name: 'billing.features.custom_branding',
|
|
50
|
+
description: 'billing.features.custom_branding_description',
|
|
51
|
+
},
|
|
52
|
+
white_label: {
|
|
53
|
+
name: 'billing.features.white_label',
|
|
54
|
+
description: 'billing.features.white_label_description',
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
// Security features
|
|
58
|
+
sso: {
|
|
59
|
+
name: 'billing.features.sso',
|
|
60
|
+
description: 'billing.features.sso_description',
|
|
61
|
+
},
|
|
62
|
+
audit_logs: {
|
|
63
|
+
name: 'billing.features.audit_logs',
|
|
64
|
+
description: 'billing.features.audit_logs_description',
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
// Support features
|
|
68
|
+
priority_support: {
|
|
69
|
+
name: 'billing.features.priority_support',
|
|
70
|
+
description: 'billing.features.priority_support_description',
|
|
71
|
+
},
|
|
72
|
+
dedicated_support: {
|
|
73
|
+
name: 'billing.features.dedicated_support',
|
|
74
|
+
description: 'billing.features.dedicated_support_description',
|
|
75
|
+
},
|
|
76
|
+
|
|
77
|
+
// Collaboration features
|
|
78
|
+
guest_access: {
|
|
79
|
+
name: 'billing.features.guest_access',
|
|
80
|
+
description: 'billing.features.guest_access_description',
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
// Domain-specific features (tasks & customers)
|
|
84
|
+
task_automation: {
|
|
85
|
+
name: 'billing.features.task_automation',
|
|
86
|
+
description: 'billing.features.task_automation_description',
|
|
87
|
+
},
|
|
88
|
+
customer_import: {
|
|
89
|
+
name: 'billing.features.customer_import',
|
|
90
|
+
description: 'billing.features.customer_import_description',
|
|
91
|
+
},
|
|
92
|
+
recurring_tasks: {
|
|
93
|
+
name: 'billing.features.recurring_tasks',
|
|
94
|
+
description: 'billing.features.recurring_tasks_description',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
// ===========================================
|
|
99
|
+
// LIMIT DEFINITIONS
|
|
100
|
+
// ===========================================
|
|
101
|
+
// Note: Limits correspond to actual entities in the theme (tasks, customers)
|
|
102
|
+
// and system resources (team_members, storage, api_calls)
|
|
103
|
+
limits: {
|
|
104
|
+
team_members: {
|
|
105
|
+
name: 'billing.limits.team_members',
|
|
106
|
+
unit: 'count',
|
|
107
|
+
resetPeriod: 'never',
|
|
108
|
+
},
|
|
109
|
+
tasks: {
|
|
110
|
+
name: 'billing.limits.tasks',
|
|
111
|
+
unit: 'count',
|
|
112
|
+
resetPeriod: 'never',
|
|
113
|
+
},
|
|
114
|
+
customers: {
|
|
115
|
+
name: 'billing.limits.customers',
|
|
116
|
+
unit: 'count',
|
|
117
|
+
resetPeriod: 'never',
|
|
118
|
+
},
|
|
119
|
+
api_calls: {
|
|
120
|
+
name: 'billing.limits.api_calls',
|
|
121
|
+
unit: 'calls',
|
|
122
|
+
resetPeriod: 'monthly',
|
|
123
|
+
},
|
|
124
|
+
storage_gb: {
|
|
125
|
+
name: 'billing.limits.storage',
|
|
126
|
+
unit: 'bytes',
|
|
127
|
+
resetPeriod: 'never',
|
|
128
|
+
},
|
|
129
|
+
file_uploads: {
|
|
130
|
+
name: 'billing.limits.file_uploads',
|
|
131
|
+
unit: 'count',
|
|
132
|
+
resetPeriod: 'monthly',
|
|
133
|
+
},
|
|
134
|
+
webhooks_count: {
|
|
135
|
+
name: 'billing.limits.webhooks_count',
|
|
136
|
+
unit: 'count',
|
|
137
|
+
resetPeriod: 'never',
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
// ===========================================
|
|
142
|
+
// PLAN DEFINITIONS
|
|
143
|
+
// ===========================================
|
|
144
|
+
plans: [
|
|
145
|
+
// Free Plan - Basic access for small teams
|
|
146
|
+
{
|
|
147
|
+
slug: 'free',
|
|
148
|
+
name: 'billing.plans.free.name',
|
|
149
|
+
description: 'billing.plans.free.description',
|
|
150
|
+
type: 'free',
|
|
151
|
+
visibility: 'public',
|
|
152
|
+
price: { monthly: 0, yearly: 0 },
|
|
153
|
+
trialDays: 0,
|
|
154
|
+
features: [
|
|
155
|
+
'basic_analytics',
|
|
156
|
+
],
|
|
157
|
+
limits: {
|
|
158
|
+
team_members: 3,
|
|
159
|
+
tasks: 50,
|
|
160
|
+
customers: 25,
|
|
161
|
+
api_calls: 1000,
|
|
162
|
+
storage_gb: 1,
|
|
163
|
+
file_uploads: 100,
|
|
164
|
+
webhooks_count: 0,
|
|
165
|
+
},
|
|
166
|
+
stripePriceIdMonthly: null,
|
|
167
|
+
stripePriceIdYearly: null,
|
|
168
|
+
},
|
|
169
|
+
|
|
170
|
+
// Starter Plan - For growing teams
|
|
171
|
+
{
|
|
172
|
+
slug: 'starter',
|
|
173
|
+
name: 'billing.plans.starter.name',
|
|
174
|
+
description: 'billing.plans.starter.description',
|
|
175
|
+
type: 'paid',
|
|
176
|
+
visibility: 'public',
|
|
177
|
+
price: {
|
|
178
|
+
monthly: 1500, // $15.00
|
|
179
|
+
yearly: 14400, // $144.00 (20% savings)
|
|
180
|
+
},
|
|
181
|
+
trialDays: 7,
|
|
182
|
+
features: [
|
|
183
|
+
'basic_analytics',
|
|
184
|
+
'advanced_analytics',
|
|
185
|
+
'api_access',
|
|
186
|
+
'guest_access',
|
|
187
|
+
],
|
|
188
|
+
limits: {
|
|
189
|
+
team_members: 5,
|
|
190
|
+
tasks: 200,
|
|
191
|
+
customers: 100,
|
|
192
|
+
api_calls: 10000,
|
|
193
|
+
storage_gb: 10,
|
|
194
|
+
file_uploads: 500,
|
|
195
|
+
webhooks_count: 3,
|
|
196
|
+
},
|
|
197
|
+
stripePriceIdMonthly: 'price_starter_monthly',
|
|
198
|
+
stripePriceIdYearly: 'price_starter_yearly',
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
// Pro Plan - For professional teams
|
|
202
|
+
{
|
|
203
|
+
slug: 'pro',
|
|
204
|
+
name: 'billing.plans.pro.name',
|
|
205
|
+
description: 'billing.plans.pro.description',
|
|
206
|
+
type: 'paid',
|
|
207
|
+
visibility: 'public',
|
|
208
|
+
price: {
|
|
209
|
+
monthly: 2900, // $29.00
|
|
210
|
+
yearly: 29000, // $290.00 (16% savings)
|
|
211
|
+
},
|
|
212
|
+
trialDays: 14,
|
|
213
|
+
features: [
|
|
214
|
+
'basic_analytics',
|
|
215
|
+
'advanced_analytics',
|
|
216
|
+
'realtime_analytics',
|
|
217
|
+
'api_access',
|
|
218
|
+
'webhooks',
|
|
219
|
+
'custom_branding',
|
|
220
|
+
'guest_access',
|
|
221
|
+
'priority_support',
|
|
222
|
+
'task_automation',
|
|
223
|
+
],
|
|
224
|
+
limits: {
|
|
225
|
+
team_members: 15,
|
|
226
|
+
tasks: 1000,
|
|
227
|
+
customers: 500,
|
|
228
|
+
api_calls: 100000,
|
|
229
|
+
storage_gb: 50,
|
|
230
|
+
file_uploads: 2000,
|
|
231
|
+
webhooks_count: 10,
|
|
232
|
+
},
|
|
233
|
+
stripePriceIdMonthly: 'price_pro_monthly',
|
|
234
|
+
stripePriceIdYearly: 'price_pro_yearly',
|
|
235
|
+
},
|
|
236
|
+
|
|
237
|
+
// Business Plan - For larger organizations
|
|
238
|
+
{
|
|
239
|
+
slug: 'business',
|
|
240
|
+
name: 'billing.plans.business.name',
|
|
241
|
+
description: 'billing.plans.business.description',
|
|
242
|
+
type: 'paid',
|
|
243
|
+
visibility: 'public',
|
|
244
|
+
price: {
|
|
245
|
+
monthly: 7900, // $79.00
|
|
246
|
+
yearly: 79000, // $790.00 (16% savings)
|
|
247
|
+
},
|
|
248
|
+
trialDays: 14,
|
|
249
|
+
features: [
|
|
250
|
+
'basic_analytics',
|
|
251
|
+
'advanced_analytics',
|
|
252
|
+
'realtime_analytics',
|
|
253
|
+
'api_access',
|
|
254
|
+
'webhooks',
|
|
255
|
+
'custom_branding',
|
|
256
|
+
'sso',
|
|
257
|
+
'audit_logs',
|
|
258
|
+
'guest_access',
|
|
259
|
+
'priority_support',
|
|
260
|
+
'task_automation',
|
|
261
|
+
'customer_import',
|
|
262
|
+
'recurring_tasks',
|
|
263
|
+
],
|
|
264
|
+
limits: {
|
|
265
|
+
team_members: 50,
|
|
266
|
+
tasks: 5000,
|
|
267
|
+
customers: 2000,
|
|
268
|
+
api_calls: 500000,
|
|
269
|
+
storage_gb: 200,
|
|
270
|
+
file_uploads: 10000,
|
|
271
|
+
webhooks_count: 50,
|
|
272
|
+
},
|
|
273
|
+
stripePriceIdMonthly: 'price_business_monthly',
|
|
274
|
+
stripePriceIdYearly: 'price_business_yearly',
|
|
275
|
+
},
|
|
276
|
+
|
|
277
|
+
// Enterprise Plan - Custom unlimited plan
|
|
278
|
+
{
|
|
279
|
+
slug: 'enterprise',
|
|
280
|
+
name: 'billing.plans.enterprise.name',
|
|
281
|
+
description: 'billing.plans.enterprise.description',
|
|
282
|
+
type: 'enterprise',
|
|
283
|
+
visibility: 'hidden',
|
|
284
|
+
trialDays: 30,
|
|
285
|
+
features: ['*'], // All features
|
|
286
|
+
limits: {
|
|
287
|
+
team_members: -1, // Unlimited
|
|
288
|
+
tasks: -1,
|
|
289
|
+
customers: -1,
|
|
290
|
+
api_calls: -1,
|
|
291
|
+
storage_gb: -1,
|
|
292
|
+
file_uploads: -1,
|
|
293
|
+
webhooks_count: -1,
|
|
294
|
+
},
|
|
295
|
+
stripePriceIdMonthly: null,
|
|
296
|
+
stripePriceIdYearly: null,
|
|
297
|
+
},
|
|
298
|
+
],
|
|
299
|
+
|
|
300
|
+
// ===========================================
|
|
301
|
+
// ACTION MAPPINGS
|
|
302
|
+
// ===========================================
|
|
303
|
+
// Maps user actions to RBAC permissions, plan features, and limits.
|
|
304
|
+
// This is the "three-layer model": RESULT = Permission AND Feature AND Quota
|
|
305
|
+
actionMappings: {
|
|
306
|
+
// RBAC permissions (optional - integrates with existing permission system)
|
|
307
|
+
permissions: {
|
|
308
|
+
'team.members.invite': 'team.members.invite',
|
|
309
|
+
'team.settings.edit': 'team.settings.edit',
|
|
310
|
+
'team.billing.manage': 'team.billing.manage',
|
|
311
|
+
},
|
|
312
|
+
|
|
313
|
+
// Feature requirements per action
|
|
314
|
+
features: {
|
|
315
|
+
// Analytics features
|
|
316
|
+
'analytics.view_advanced': 'advanced_analytics',
|
|
317
|
+
'analytics.view_realtime': 'realtime_analytics',
|
|
318
|
+
// API features
|
|
319
|
+
'api.generate_key': 'api_access',
|
|
320
|
+
'webhooks.create': 'webhooks',
|
|
321
|
+
// Branding features
|
|
322
|
+
'branding.customize': 'custom_branding',
|
|
323
|
+
'branding.white_label': 'white_label',
|
|
324
|
+
// Security features
|
|
325
|
+
'auth.configure_sso': 'sso',
|
|
326
|
+
'security.view_audit_logs': 'audit_logs',
|
|
327
|
+
// Support features
|
|
328
|
+
'support.priority_access': 'priority_support',
|
|
329
|
+
'support.dedicated_channel': 'dedicated_support',
|
|
330
|
+
// Collaboration features
|
|
331
|
+
'team.invite_guest': 'guest_access',
|
|
332
|
+
// Domain-specific features (tasks & customers)
|
|
333
|
+
'tasks.automate': 'task_automation',
|
|
334
|
+
'tasks.create_recurring': 'recurring_tasks',
|
|
335
|
+
'customers.bulk_import': 'customer_import',
|
|
336
|
+
},
|
|
337
|
+
|
|
338
|
+
// Limit consumption per action (maps to actual entities)
|
|
339
|
+
limits: {
|
|
340
|
+
'team.members.invite': 'team_members',
|
|
341
|
+
'tasks.create': 'tasks',
|
|
342
|
+
'customers.create': 'customers',
|
|
343
|
+
'api.call': 'api_calls',
|
|
344
|
+
'files.upload': 'storage_gb',
|
|
345
|
+
'files.upload_count': 'file_uploads',
|
|
346
|
+
'webhooks.create': 'webhooks_count',
|
|
347
|
+
},
|
|
348
|
+
},
|
|
349
|
+
}
|