-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodules.ts
More file actions
72 lines (66 loc) · 3.42 KB
/
Copy pathmodules.ts
File metadata and controls
72 lines (66 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Central place to enable modules and their source.
// - id: module id (plural snake_case; special cases: 'auth')
// - from: '@open-mercato/core' | '@app' | custom alias/path in future
import { parseBooleanWithDefault } from '@open-mercato/shared/lib/boolean'
export type ModuleEntry = { id: string; from?: '@open-mercato/core' | '@app' | string }
export const enabledModules: ModuleEntry[] = [
{ id: 'dashboards', from: '@open-mercato/core' },
{ id: 'auth', from: '@open-mercato/core' },
{ id: 'directory', from: '@open-mercato/core' },
{ id: 'customers', from: '@open-mercato/core' },
{ id: 'perspectives', from: '@open-mercato/core' },
{ id: 'entities', from: '@open-mercato/core' },
{ id: 'configs', from: '@open-mercato/core' },
{ id: 'query_index', from: '@open-mercato/core' },
{ id: 'audit_logs', from: '@open-mercato/core' },
{ id: 'attachments', from: '@open-mercato/core' },
{ id: 'catalog', from: '@open-mercato/core' },
{ id: 'sales', from: '@open-mercato/core' },
{ id: 'api_keys', from: '@open-mercato/core' },
{ id: 'dictionaries', from: '@open-mercato/core' },
{ id: 'content', from: '@open-mercato/content' },
{ id: 'onboarding', from: '@open-mercato/onboarding' },
{ id: 'api_docs', from: '@open-mercato/core' },
{ id: 'business_rules', from: '@open-mercato/core' },
{ id: 'feature_toggles', from: '@open-mercato/core' },
{ id: 'workflows', from: '@open-mercato/core' },
{ id: 'search', from: '@open-mercato/search' },
{ id: 'currencies', from: '@open-mercato/core' },
{ id: 'planner', from: '@open-mercato/core' },
{ id: 'resources', from: '@open-mercato/core' },
{ id: 'staff', from: '@open-mercato/core' },
{ id: 'events', from: '@open-mercato/events' },
{ id: 'notifications', from: '@open-mercato/core' },
{ id: 'progress', from: '@open-mercato/core' },
{ id: 'integrations', from: '@open-mercato/core' },
{ id: 'data_sync', from: '@open-mercato/core' },
{ id: 'messages', from: '@open-mercato/core' },
{ id: 'ai_assistant', from: '@open-mercato/ai-assistant' },
{ id: 'translations', from: '@open-mercato/core' },
{ id: 'scheduler', from: '@open-mercato/scheduler' },
{ id: 'inbox_ops', from: '@open-mercato/core' },
{ id: 'payment_gateways', from: '@open-mercato/core' },
{ id: 'checkout', from: '@open-mercato/checkout' },
{ id: 'gateway_stripe', from: '@open-mercato/gateway-stripe' },
{ id: 'sync_akeneo', from: '@open-mercato/sync-akeneo' },
{ id: 'shipping_carriers', from: '@open-mercato/core' },
{ id: 'webhooks', from: '@open-mercato/webhooks' },
{ id: 'customer_accounts', from: '@open-mercato/core' },
{ id: 'portal', from: '@open-mercato/core' },
{ id: 'example', from: '@app' },
]
const enterpriseModulesEnabled = parseBooleanWithDefault(process.env.OM_ENABLE_ENTERPRISE_MODULES, false)
const enterpriseSsoEnabled = parseBooleanWithDefault(process.env.OM_ENABLE_ENTERPRISE_MODULES_SSO, false)
const enterpriseSecurityEnabled = parseBooleanWithDefault(process.env.OM_ENABLE_ENTERPRISE_MODULES_SECURITY, false)
if (enterpriseModulesEnabled) {
enabledModules.push(
{ id: 'record_locks', from: '@open-mercato/enterprise' },
{ id: 'system_status_overlays', from: '@open-mercato/enterprise' },
)
}
if (enterpriseModulesEnabled && enterpriseSsoEnabled) {
enabledModules.push({ id: 'sso', from: '@open-mercato/enterprise' })
}
if (enterpriseModulesEnabled && enterpriseSecurityEnabled) {
enabledModules.push({ id: 'security', from: '@open-mercato/enterprise' })
}