@contractspec/example.crm-pipeline 3.7.5 → 3.7.7
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/.turbo/turbo-build.log +8 -8
- package/AGENTS.md +51 -33
- package/CHANGELOG.md +16 -0
- package/README.md +66 -148
- package/dist/browser/events/contact.event.js +1 -1
- package/dist/browser/events/deal.event.js +1 -1
- package/dist/browser/events/index.js +3 -3
- package/dist/browser/events/task.event.js +1 -1
- package/dist/browser/index.js +293 -293
- package/dist/browser/ui/CrmDashboard.js +221 -221
- package/dist/browser/ui/CrmDealCard.js +5 -5
- package/dist/browser/ui/CrmPipelineBoard.js +13 -13
- package/dist/browser/ui/hooks/index.js +2 -2
- package/dist/browser/ui/hooks/useDealList.js +1 -1
- package/dist/browser/ui/hooks/useDealMutations.js +1 -1
- package/dist/browser/ui/index.js +290 -290
- package/dist/browser/ui/modals/CreateDealModal.js +12 -12
- package/dist/browser/ui/modals/DealActionsModal.js +21 -21
- package/dist/browser/ui/modals/index.js +33 -33
- package/dist/browser/ui/renderers/index.js +116 -116
- package/dist/browser/ui/renderers/pipeline.renderer.js +97 -97
- package/dist/deal/index.d.ts +2 -2
- package/dist/events/contact.event.js +1 -1
- package/dist/events/deal.event.js +1 -1
- package/dist/events/index.js +3 -3
- package/dist/events/task.event.js +1 -1
- package/dist/handlers/index.d.ts +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +293 -293
- package/dist/node/events/contact.event.js +1 -1
- package/dist/node/events/deal.event.js +1 -1
- package/dist/node/events/index.js +3 -3
- package/dist/node/events/task.event.js +1 -1
- package/dist/node/index.js +293 -293
- package/dist/node/ui/CrmDashboard.js +221 -221
- package/dist/node/ui/CrmDealCard.js +5 -5
- package/dist/node/ui/CrmPipelineBoard.js +13 -13
- package/dist/node/ui/hooks/index.js +2 -2
- package/dist/node/ui/hooks/useDealList.js +1 -1
- package/dist/node/ui/hooks/useDealMutations.js +1 -1
- package/dist/node/ui/index.js +290 -290
- package/dist/node/ui/modals/CreateDealModal.js +12 -12
- package/dist/node/ui/modals/DealActionsModal.js +21 -21
- package/dist/node/ui/modals/index.js +33 -33
- package/dist/node/ui/renderers/index.js +116 -116
- package/dist/node/ui/renderers/pipeline.renderer.js +97 -97
- package/dist/operations/index.d.ts +1 -1
- package/dist/ui/CrmDashboard.js +221 -221
- package/dist/ui/CrmDealCard.js +5 -5
- package/dist/ui/CrmPipelineBoard.js +13 -13
- package/dist/ui/hooks/index.d.ts +2 -2
- package/dist/ui/hooks/index.js +2 -2
- package/dist/ui/hooks/useDealList.js +1 -1
- package/dist/ui/hooks/useDealMutations.d.ts +9 -0
- package/dist/ui/hooks/useDealMutations.js +1 -1
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.js +290 -290
- package/dist/ui/modals/CreateDealModal.js +12 -12
- package/dist/ui/modals/DealActionsModal.js +21 -21
- package/dist/ui/modals/index.js +33 -33
- package/dist/ui/renderers/index.d.ts +1 -1
- package/dist/ui/renderers/index.js +116 -116
- package/dist/ui/renderers/pipeline.renderer.d.ts +1 -1
- package/dist/ui/renderers/pipeline.renderer.js +97 -97
- package/package.json +14 -14
- package/src/crm-pipeline.feature.ts +86 -86
- package/src/deal/deal.enum.ts +8 -8
- package/src/deal/deal.operation.ts +255 -255
- package/src/deal/deal.schema.ts +92 -92
- package/src/deal/deal.test-spec.ts +48 -48
- package/src/deal/index.ts +17 -19
- package/src/docs/crm-pipeline.docblock.ts +43 -43
- package/src/entities/company.entity.ts +52 -52
- package/src/entities/contact.entity.ts +67 -67
- package/src/entities/deal.entity.ts +134 -134
- package/src/entities/index.ts +27 -27
- package/src/entities/task.entity.ts +105 -105
- package/src/events/contact.event.ts +22 -22
- package/src/events/deal.event.ts +77 -77
- package/src/events/task.event.ts +19 -19
- package/src/example.ts +32 -32
- package/src/handlers/crm.handlers.ts +358 -357
- package/src/handlers/deal.handlers.ts +179 -179
- package/src/handlers/index.ts +18 -19
- package/src/handlers/mock-data.ts +167 -167
- package/src/index.ts +11 -11
- package/src/operations/index.ts +16 -16
- package/src/presentations/dashboard.presentation.ts +45 -45
- package/src/presentations/pipeline.presentation.ts +90 -90
- package/src/seeders/index.ts +26 -26
- package/src/shared/overlay-types.ts +23 -23
- package/src/ui/CrmDashboard.tsx +256 -256
- package/src/ui/CrmDealCard.tsx +64 -64
- package/src/ui/CrmPipelineBoard.tsx +105 -105
- package/src/ui/hooks/index.ts +3 -3
- package/src/ui/hooks/useDealList.ts +85 -85
- package/src/ui/hooks/useDealMutations.ts +151 -150
- package/src/ui/index.ts +5 -10
- package/src/ui/modals/CreateDealModal.tsx +217 -217
- package/src/ui/modals/DealActionsModal.tsx +390 -390
- package/src/ui/overlays/demo-overlays.ts +43 -43
- package/src/ui/renderers/index.ts +4 -3
- package/src/ui/renderers/pipeline.markdown.ts +165 -165
- package/src/ui/renderers/pipeline.renderer.tsx +17 -16
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.crm-pipeline",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.7",
|
|
4
4
|
"description": "CRM Pipeline - Contacts, Companies, Deals, Tasks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -323,32 +323,32 @@
|
|
|
323
323
|
"dev": "contractspec-bun-build dev",
|
|
324
324
|
"clean": "rimraf dist .turbo",
|
|
325
325
|
"lint": "bun lint:fix",
|
|
326
|
-
"lint:fix": "
|
|
327
|
-
"lint:check": "
|
|
326
|
+
"lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
|
|
327
|
+
"lint:check": "biome check .",
|
|
328
328
|
"test": "bun test --pass-with-no-tests",
|
|
329
329
|
"validate": "contractspec validate \"src/**/*\"",
|
|
330
330
|
"prebuild": "contractspec-bun-build prebuild",
|
|
331
331
|
"typecheck": "tsc --noEmit"
|
|
332
332
|
},
|
|
333
333
|
"dependencies": {
|
|
334
|
-
"@contractspec/lib.contracts-spec": "
|
|
335
|
-
"@contractspec/lib.design-system": "3.
|
|
336
|
-
"@contractspec/lib.example-shared-ui": "6.0.
|
|
337
|
-
"@contractspec/lib.identity-rbac": "3.7.
|
|
338
|
-
"@contractspec/lib.runtime-sandbox": "2.7.
|
|
339
|
-
"@contractspec/lib.schema": "3.7.
|
|
340
|
-
"@contractspec/lib.ui-kit-web": "3.
|
|
341
|
-
"@contractspec/module.audit-trail": "3.7.
|
|
342
|
-
"@contractspec/module.notifications": "3.7.
|
|
334
|
+
"@contractspec/lib.contracts-spec": "4.0.0",
|
|
335
|
+
"@contractspec/lib.design-system": "3.8.0",
|
|
336
|
+
"@contractspec/lib.example-shared-ui": "6.0.7",
|
|
337
|
+
"@contractspec/lib.identity-rbac": "3.7.7",
|
|
338
|
+
"@contractspec/lib.runtime-sandbox": "2.7.6",
|
|
339
|
+
"@contractspec/lib.schema": "3.7.6",
|
|
340
|
+
"@contractspec/lib.ui-kit-web": "3.8.0",
|
|
341
|
+
"@contractspec/module.audit-trail": "3.7.7",
|
|
342
|
+
"@contractspec/module.notifications": "3.7.7",
|
|
343
343
|
"react": "19.2.0",
|
|
344
344
|
"react-dom": "19.2.0"
|
|
345
345
|
},
|
|
346
346
|
"devDependencies": {
|
|
347
|
-
"@contractspec/tool.typescript": "3.7.
|
|
347
|
+
"@contractspec/tool.typescript": "3.7.6",
|
|
348
348
|
"typescript": "^5.9.3",
|
|
349
349
|
"@types/react": "^19.2.14",
|
|
350
350
|
"@types/react-dom": "^19.2.2",
|
|
351
|
-
"@contractspec/tool.bun": "3.7.
|
|
351
|
+
"@contractspec/tool.bun": "3.7.6"
|
|
352
352
|
},
|
|
353
353
|
"publishConfig": {
|
|
354
354
|
"exports": {
|
|
@@ -10,100 +10,100 @@ import { defineFeature } from '@contractspec/lib.contracts-spec';
|
|
|
10
10
|
* pipeline operations, and contact management into an installable feature.
|
|
11
11
|
*/
|
|
12
12
|
export const CrmPipelineFeature = defineFeature({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
meta: {
|
|
14
|
+
key: 'crm-pipeline',
|
|
15
|
+
title: 'CRM Pipeline',
|
|
16
|
+
description:
|
|
17
|
+
'CRM and sales pipeline management with deals, contacts, and companies',
|
|
18
|
+
domain: 'crm',
|
|
19
|
+
owners: ['@crm-team'],
|
|
20
|
+
tags: ['crm', 'sales', 'pipeline', 'deals'],
|
|
21
|
+
stability: 'experimental',
|
|
22
|
+
version: '1.0.0',
|
|
23
|
+
},
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
// All contract operations included in this feature
|
|
26
|
+
operations: [
|
|
27
|
+
// Deal operations
|
|
28
|
+
{ key: 'crm.deal.create', version: '1.0.0' },
|
|
29
|
+
{ key: 'crm.deal.move', version: '1.0.0' },
|
|
30
|
+
{ key: 'crm.deal.win', version: '1.0.0' },
|
|
31
|
+
{ key: 'crm.deal.lose', version: '1.0.0' },
|
|
32
|
+
{ key: 'crm.deal.list', version: '1.0.0' },
|
|
33
|
+
],
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
// Events emitted by this feature
|
|
36
|
+
events: [
|
|
37
|
+
// Deal events
|
|
38
|
+
{ key: 'deal.created', version: '1.0.0' },
|
|
39
|
+
{ key: 'deal.moved', version: '1.0.0' },
|
|
40
|
+
{ key: 'deal.won', version: '1.0.0' },
|
|
41
|
+
{ key: 'deal.lost', version: '1.0.0' },
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
// Contact events
|
|
44
|
+
{ key: 'contact.created', version: '1.0.0' },
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
// Task events
|
|
47
|
+
{ key: 'task.completed', version: '1.0.0' },
|
|
48
|
+
],
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
50
|
+
// Presentations associated with this feature
|
|
51
|
+
presentations: [
|
|
52
|
+
{ key: 'crm.dashboard', version: '1.0.0' },
|
|
53
|
+
{ key: 'crm.pipeline.kanban', version: '1.0.0' },
|
|
54
|
+
{ key: 'crm.deal.viewList', version: '1.0.0' },
|
|
55
|
+
{ key: 'crm.deal.detail', version: '1.0.0' },
|
|
56
|
+
{ key: 'crm.deal.card', version: '1.0.0' },
|
|
57
|
+
{ key: 'crm.pipeline.metrics', version: '1.0.0' },
|
|
58
|
+
],
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
60
|
+
// Link operations to their primary presentations
|
|
61
|
+
opToPresentation: [
|
|
62
|
+
{
|
|
63
|
+
op: { key: 'crm.deal.list', version: '1.0.0' },
|
|
64
|
+
pres: { key: 'crm.pipeline.kanban', version: '1.0.0' },
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
op: { key: 'crm.deal.move', version: '1.0.0' },
|
|
68
|
+
pres: { key: 'crm.pipeline.kanban', version: '1.0.0' },
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
72
|
+
// Target requirements for multi-surface rendering
|
|
73
|
+
presentationsTargets: [
|
|
74
|
+
{ key: 'crm.dashboard', version: '1.0.0', targets: ['react', 'markdown'] },
|
|
75
|
+
{
|
|
76
|
+
key: 'crm.pipeline.kanban',
|
|
77
|
+
version: '1.0.0',
|
|
78
|
+
targets: ['react', 'markdown'],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
key: 'crm.deal.viewList',
|
|
82
|
+
version: '1.0.0',
|
|
83
|
+
targets: ['react', 'markdown', 'application/json'],
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: 'crm.pipeline.metrics',
|
|
87
|
+
version: '1.0.0',
|
|
88
|
+
targets: ['react', 'markdown'],
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
// Capability requirements
|
|
93
|
+
capabilities: {
|
|
94
|
+
requires: [
|
|
95
|
+
{ key: 'identity', version: '1.0.0' },
|
|
96
|
+
{ key: 'audit-trail', version: '1.0.0' },
|
|
97
|
+
{ key: 'notifications', version: '1.0.0' },
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
telemetry: [{ key: 'crm-pipeline.telemetry', version: '1.0.0' }],
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
103
|
+
docs: [
|
|
104
|
+
'docs.examples.crm-pipeline.goal',
|
|
105
|
+
'docs.examples.crm-pipeline.usage',
|
|
106
|
+
'docs.examples.crm-pipeline.reference',
|
|
107
|
+
'docs.examples.crm-pipeline.constraints',
|
|
108
|
+
],
|
|
109
109
|
});
|
package/src/deal/deal.enum.ts
CHANGED
|
@@ -4,18 +4,18 @@ import { defineEnum } from '@contractspec/lib.schema';
|
|
|
4
4
|
* Deal status enum.
|
|
5
5
|
*/
|
|
6
6
|
export const DealStatusEnum = defineEnum('DealStatus', [
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
'OPEN',
|
|
8
|
+
'WON',
|
|
9
|
+
'LOST',
|
|
10
|
+
'STALE',
|
|
11
11
|
]);
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Deal status filter enum.
|
|
15
15
|
*/
|
|
16
16
|
export const DealStatusFilterEnum = defineEnum('DealStatusFilter', [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
'OPEN',
|
|
18
|
+
'WON',
|
|
19
|
+
'LOST',
|
|
20
|
+
'all',
|
|
21
21
|
]);
|