-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathobjectstack.config.ts
More file actions
102 lines (91 loc) · 3.39 KB
/
Copy pathobjectstack.config.ts
File metadata and controls
102 lines (91 loc) · 3.39 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
import { defineStack } from '@objectstack/spec';
import * as objects from './src/objects/index.js';
import * as views from './src/views/index.js';
import * as apps from './src/apps/index.js';
import * as dashboards from './src/dashboards/index.js';
import * as datasets from './src/datasets/index.js';
import * as pages from './src/pages/index.js';
import * as actions from './src/actions/index.js';
import { allHooks } from './src/hooks/index.js';
import { allFlows } from './src/flows/index.js';
import {
SalesRepPosition,
SalesManagerPosition,
FinanceApproverPosition,
SalesUserPermissionSet,
GuestPortalProfile,
HighValueOpportunitySharingRule,
RepLeadSharingRule,
WonDealActivitySharingRule,
} from './src/security/index.js';
import { CrmSeedData } from './src/data/index.js';
import { CrmDatasource, CrmAnalyticsDatasource } from './src/datasources/crm.datasource.js';
import { CrmTranslationBundle } from './src/translations/crm.translation.js';
/**
* CRM example — a MINIMAL, realistic relational bundle that smoke-tests the
* metadata application loading pipeline: objects/relationships → views →
* app → dashboard (dataset-backed) → hook → one screen-flow wizard → seed.
* Deliberately small so `pnpm dev:crm` boots fast for backend debugging.
*
* NOT a feature showcase: capability breadth (cubes, extensions, apis,
* webhooks, portals, themes, reports, jobs, emails, automation variety)
* lives in examples/app-showcase, whose coverage manifest enforces it.
* For a full enterprise reference see https://github.com/objectstack-ai/hotcrm
*/
export default defineStack({
manifest: {
id: 'com.example.crm',
namespace: 'crm',
version: '4.0.0',
type: 'app',
name: 'CRM (minimal example)',
description: 'Minimal CRM workspace used by the framework to validate the metadata loading pipeline end-to-end.',
},
// Auto-resolved by the CLI; `ui` enables the Studio shell, `automation`
// loads AutomationServicePlugin + node packs so the convert-lead screen
// flow can execute.
requires: ['ui', 'automation'],
// Infrastructure
datasources: [CrmDatasource, CrmAnalyticsDatasource],
datasourceMapping: [
{ namespace: 'crm', datasource: 'crm_primary' },
{ default: true, datasource: 'crm_primary' },
],
// Internationalisation
translations: [CrmTranslationBundle],
i18n: {
defaultLocale: 'en',
supportedLocales: ['en', 'zh-CN'],
fallbackLocale: 'en',
messageFormat: 'simple',
lazyLoad: false,
cache: true,
},
// Data
objects: Object.values(objects),
// UI
apps: Object.values(apps),
views: Object.values(views),
pages: Object.values(pages),
dashboards: Object.values(dashboards),
datasets: Object.values(datasets),
actions: Object.values(actions),
// Logic
hooks: allHooks,
// ADR-0020: `workflows` retired — record state machines are a
// `state_machine` validation rule on the object (see
// src/objects/opportunity.object.ts). One flow only: the convert-lead
// screen wizard the smoke test drives.
flows: allFlows,
// Security
positions: [SalesRepPosition, SalesManagerPosition, FinanceApproverPosition],
permissions: [SalesUserPermissionSet, GuestPortalProfile],
sharingRules: [
HighValueOpportunitySharingRule,
RepLeadSharingRule,
WonDealActivitySharingRule,
],
// Seed data
data: CrmSeedData,
});