@lssm/example.crm-pipeline 0.0.0-canary-20251217034842 → 0.0.0-canary-20251217060433

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.
@@ -0,0 +1,28 @@
1
+ import * as _lssm_lib_schema27 from "@lssm/lib.schema";
2
+ import * as _lssm_lib_contracts3 from "@lssm/lib.contracts";
3
+
4
+ //#region src/events/task.event.d.ts
5
+ declare const TaskCompletedEvent: _lssm_lib_contracts3.EventSpec<_lssm_lib_schema27.SchemaModel<{
6
+ taskId: {
7
+ type: _lssm_lib_schema27.FieldType<string, string>;
8
+ isOptional: false;
9
+ };
10
+ type: {
11
+ type: _lssm_lib_schema27.FieldType<string, string>;
12
+ isOptional: false;
13
+ };
14
+ assignedTo: {
15
+ type: _lssm_lib_schema27.FieldType<string, string>;
16
+ isOptional: false;
17
+ };
18
+ completedBy: {
19
+ type: _lssm_lib_schema27.FieldType<string, string>;
20
+ isOptional: false;
21
+ };
22
+ completedAt: {
23
+ type: _lssm_lib_schema27.FieldType<Date, string>;
24
+ isOptional: false;
25
+ };
26
+ }>>;
27
+ //#endregion
28
+ export { TaskCompletedEvent };
@@ -0,0 +1,36 @@
1
+ //#region src/example.d.ts
2
+ declare const example: {
3
+ readonly id: "crm-pipeline";
4
+ readonly title: "CRM Pipeline";
5
+ readonly summary: "Sales CRM with contacts, companies, deals, pipelines, and tasks.";
6
+ readonly tags: readonly ["crm", "sales", "pipeline", "deals"];
7
+ readonly kind: "template";
8
+ readonly visibility: "public";
9
+ readonly docs: {
10
+ readonly rootDocId: "docs.examples.crm-pipeline";
11
+ };
12
+ readonly entrypoints: {
13
+ readonly packageName: "@lssm/example.crm-pipeline";
14
+ readonly feature: "./feature";
15
+ readonly contracts: "./contracts";
16
+ readonly presentations: "./presentations";
17
+ readonly handlers: "./handlers";
18
+ readonly docs: "./docs";
19
+ };
20
+ readonly surfaces: {
21
+ readonly templates: true;
22
+ readonly sandbox: {
23
+ readonly enabled: true;
24
+ readonly modes: readonly ["playground", "specs", "builder", "markdown", "evolution"];
25
+ };
26
+ readonly studio: {
27
+ readonly enabled: true;
28
+ readonly installable: true;
29
+ };
30
+ readonly mcp: {
31
+ readonly enabled: true;
32
+ };
33
+ };
34
+ };
35
+ //#endregion
36
+ export { example as default };
@@ -0,0 +1,93 @@
1
+ import { MockStage } from "./mock-data.js";
2
+
3
+ //#region src/handlers/deal.handlers.d.ts
4
+ interface Deal {
5
+ id: string;
6
+ name: string;
7
+ value: number;
8
+ currency: string;
9
+ pipelineId: string;
10
+ stageId: string;
11
+ status: 'OPEN' | 'WON' | 'LOST' | 'STALE';
12
+ contactId?: string;
13
+ companyId?: string;
14
+ ownerId: string;
15
+ expectedCloseDate?: Date;
16
+ createdAt: Date;
17
+ updatedAt: Date;
18
+ }
19
+ interface CreateDealInput {
20
+ name: string;
21
+ value: number;
22
+ currency?: string;
23
+ pipelineId: string;
24
+ stageId: string;
25
+ contactId?: string;
26
+ companyId?: string;
27
+ expectedCloseDate?: Date;
28
+ }
29
+ interface MoveDealInput {
30
+ dealId: string;
31
+ stageId: string;
32
+ position?: number;
33
+ }
34
+ interface WinDealInput {
35
+ dealId: string;
36
+ wonSource?: string;
37
+ notes?: string;
38
+ }
39
+ interface LoseDealInput {
40
+ dealId: string;
41
+ lostReason: string;
42
+ notes?: string;
43
+ }
44
+ interface ListDealsInput {
45
+ pipelineId?: string;
46
+ stageId?: string;
47
+ status?: 'OPEN' | 'WON' | 'LOST' | 'all';
48
+ ownerId?: string;
49
+ search?: string;
50
+ limit?: number;
51
+ offset?: number;
52
+ }
53
+ interface ListDealsOutput {
54
+ deals: Deal[];
55
+ total: number;
56
+ totalValue: number;
57
+ }
58
+ /**
59
+ * Mock handler for ListDealsContract
60
+ */
61
+ declare function mockListDealsHandler(input: ListDealsInput): Promise<ListDealsOutput>;
62
+ /**
63
+ * Mock handler for CreateDealContract
64
+ */
65
+ declare function mockCreateDealHandler(input: CreateDealInput, context: {
66
+ ownerId: string;
67
+ }): Promise<Deal>;
68
+ /**
69
+ * Mock handler for MoveDealContract
70
+ */
71
+ declare function mockMoveDealHandler(input: MoveDealInput): Promise<Deal>;
72
+ /**
73
+ * Mock handler for WinDealContract
74
+ */
75
+ declare function mockWinDealHandler(input: WinDealInput): Promise<Deal>;
76
+ /**
77
+ * Mock handler for LoseDealContract
78
+ */
79
+ declare function mockLoseDealHandler(input: LoseDealInput): Promise<Deal>;
80
+ /**
81
+ * Get deals grouped by stage for Kanban view
82
+ */
83
+ declare function mockGetDealsByStageHandler(input: {
84
+ pipelineId: string;
85
+ }): Promise<Record<string, Deal[]>>;
86
+ /**
87
+ * Get pipeline stages
88
+ */
89
+ declare function mockGetPipelineStagesHandler(input: {
90
+ pipelineId: string;
91
+ }): Promise<MockStage[]>;
92
+ //#endregion
93
+ export { CreateDealInput, Deal, ListDealsInput, ListDealsOutput, LoseDealInput, MoveDealInput, WinDealInput, mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler };
@@ -0,0 +1,3 @@
1
+ import { MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES, MockDeal, MockStage } from "./mock-data.js";
2
+ import { CreateDealInput, Deal, ListDealsInput, ListDealsOutput, LoseDealInput, MoveDealInput, WinDealInput, mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler } from "./deal.handlers.js";
3
+ export { type CreateDealInput, type Deal, type ListDealsInput, type ListDealsOutput, type LoseDealInput, MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES, MockDeal, MockStage, type MoveDealInput, type WinDealInput, mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler };
@@ -0,0 +1,48 @@
1
+ //#region src/handlers/mock-data.d.ts
2
+ /**
3
+ * Mock data for crm-pipeline handlers
4
+ */
5
+ interface MockDeal {
6
+ id: string;
7
+ name: string;
8
+ value: number;
9
+ currency: string;
10
+ pipelineId: string;
11
+ stageId: string;
12
+ status: 'OPEN' | 'WON' | 'LOST' | 'STALE';
13
+ contactId?: string;
14
+ companyId?: string;
15
+ ownerId: string;
16
+ expectedCloseDate?: Date;
17
+ createdAt: Date;
18
+ updatedAt: Date;
19
+ }
20
+ interface MockStage {
21
+ id: string;
22
+ name: string;
23
+ position: number;
24
+ pipelineId: string;
25
+ }
26
+ declare const MOCK_STAGES: MockStage[];
27
+ declare const MOCK_DEALS: MockDeal[];
28
+ declare const MOCK_COMPANIES: {
29
+ id: string;
30
+ name: string;
31
+ domain: string;
32
+ industry: string;
33
+ size: string;
34
+ website: string;
35
+ createdAt: Date;
36
+ }[];
37
+ declare const MOCK_CONTACTS: {
38
+ id: string;
39
+ firstName: string;
40
+ lastName: string;
41
+ email: string;
42
+ phone: string;
43
+ title: string;
44
+ companyId: string;
45
+ createdAt: Date;
46
+ }[];
47
+ //#endregion
48
+ export { MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES, MockDeal, MockStage };
@@ -0,0 +1,33 @@
1
+ import { DealStatusFilterEnum } from "./deal/deal.enum.js";
2
+ import { CreateDealInputModel, DealLostPayloadModel, DealModel, DealMovedPayloadModel, DealWonPayloadModel, ListDealsInputModel, ListDealsOutputModel, LoseDealInputModel, MoveDealInputModel, WinDealInputModel } from "./deal/deal.schema.js";
3
+ import { CreateDealContract, ListDealsContract, LoseDealContract, MoveDealContract, WinDealContract } from "./deal/deal.contracts.js";
4
+ import "./contracts/index.js";
5
+ import { CrmPipelineFeature } from "./crm-pipeline.feature.js";
6
+ import { CompanyEntity, CompanySizeEnum } from "./entities/company.entity.js";
7
+ import { ContactEntity, ContactStatusEnum } from "./entities/contact.entity.js";
8
+ import { DealEntity, DealStatusEnum, PipelineEntity, StageEntity } from "./entities/deal.entity.js";
9
+ import { ActivityEntity, TaskEntity, TaskPriorityEnum, TaskStatusEnum, TaskTypeEnum } from "./entities/task.entity.js";
10
+ import { crmPipelineSchemaContribution } from "./entities/index.js";
11
+ import { ContactCreatedEvent } from "./events/contact.event.js";
12
+ import { DealCreatedEvent, DealLostEvent, DealMovedEvent, DealWonEvent } from "./events/deal.event.js";
13
+ import { TaskCompletedEvent } from "./events/task.event.js";
14
+ import "./events/index.js";
15
+ import example from "./example.js";
16
+ import { MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES, MockDeal, MockStage } from "./handlers/mock-data.js";
17
+ import { CreateDealInput, Deal, ListDealsInput, ListDealsOutput, LoseDealInput, MoveDealInput, WinDealInput, mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler } from "./handlers/deal.handlers.js";
18
+ import { CrmDashboardPresentation, PipelineMetricsPresentation } from "./presentations/dashboard.presentation.js";
19
+ import { DealCardPresentation, DealDetailPresentation, DealListPresentation, PipelineKanbanPresentation } from "./presentations/pipeline.presentation.js";
20
+ import "./presentations/index.js";
21
+ import * as _lssm_lib_schema286 from "@lssm/lib.schema";
22
+
23
+ //#region src/index.d.ts
24
+ /**
25
+ * Complete schema composition for CRM Pipeline.
26
+ */
27
+ declare const schemaComposition: {
28
+ modules: _lssm_lib_schema286.ModuleSchemaContribution[];
29
+ provider: "postgresql";
30
+ outputPath: string;
31
+ };
32
+ //#endregion
33
+ export { ActivityEntity, CompanyEntity, CompanySizeEnum, ContactCreatedEvent, ContactEntity, ContactStatusEnum, CreateDealContract, CreateDealInput, CreateDealInputModel, CrmDashboardPresentation, CrmPipelineFeature, Deal, DealCardPresentation, DealCreatedEvent, DealDetailPresentation, DealEntity, DealListPresentation, DealLostEvent, DealLostPayloadModel, DealModel, DealMovedEvent, DealMovedPayloadModel, DealStatusEnum, DealStatusFilterEnum, DealWonEvent, DealWonPayloadModel, ListDealsContract, ListDealsInput, ListDealsInputModel, ListDealsOutput, ListDealsOutputModel, LoseDealContract, LoseDealInput, LoseDealInputModel, MOCK_COMPANIES, MOCK_CONTACTS, MOCK_DEALS, MOCK_STAGES, MockDeal, MockStage, MoveDealContract, MoveDealInput, MoveDealInputModel, PipelineEntity, PipelineKanbanPresentation, PipelineMetricsPresentation, StageEntity, TaskCompletedEvent, TaskEntity, TaskPriorityEnum, TaskStatusEnum, TaskTypeEnum, WinDealContract, WinDealInput, WinDealInputModel, crmPipelineSchemaContribution, example, mockCreateDealHandler, mockGetDealsByStageHandler, mockGetPipelineStagesHandler, mockListDealsHandler, mockLoseDealHandler, mockMoveDealHandler, mockWinDealHandler, schemaComposition };
@@ -0,0 +1,14 @@
1
+ import { PresentationDescriptorV2 } from "@lssm/lib.contracts";
2
+
3
+ //#region src/presentations/dashboard.presentation.d.ts
4
+
5
+ /**
6
+ * Main CRM dashboard presentation.
7
+ */
8
+ declare const CrmDashboardPresentation: PresentationDescriptorV2;
9
+ /**
10
+ * Pipeline metrics presentation.
11
+ */
12
+ declare const PipelineMetricsPresentation: PresentationDescriptorV2;
13
+ //#endregion
14
+ export { CrmDashboardPresentation, PipelineMetricsPresentation };
@@ -0,0 +1,3 @@
1
+ import { CrmDashboardPresentation, PipelineMetricsPresentation } from "./dashboard.presentation.js";
2
+ import { DealCardPresentation, DealDetailPresentation, DealListPresentation, PipelineKanbanPresentation } from "./pipeline.presentation.js";
3
+ export { CrmDashboardPresentation, DealCardPresentation, DealDetailPresentation, DealListPresentation, PipelineKanbanPresentation, PipelineMetricsPresentation };
@@ -0,0 +1,22 @@
1
+ import { PresentationDescriptorV2 } from "@lssm/lib.contracts";
2
+
3
+ //#region src/presentations/pipeline.presentation.d.ts
4
+
5
+ /**
6
+ * Kanban board presentation for the sales pipeline.
7
+ */
8
+ declare const PipelineKanbanPresentation: PresentationDescriptorV2;
9
+ /**
10
+ * List view of deals with filtering.
11
+ */
12
+ declare const DealListPresentation: PresentationDescriptorV2;
13
+ /**
14
+ * Deal detail presentation.
15
+ */
16
+ declare const DealDetailPresentation: PresentationDescriptorV2;
17
+ /**
18
+ * Deal card for kanban board.
19
+ */
20
+ declare const DealCardPresentation: PresentationDescriptorV2;
21
+ //#endregion
22
+ export { DealCardPresentation, DealDetailPresentation, DealListPresentation, PipelineKanbanPresentation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lssm/example.crm-pipeline",
3
- "version": "0.0.0-canary-20251217034842",
3
+ "version": "0.0.0-canary-20251217060433",
4
4
  "description": "CRM Pipeline - Contacts, Companies, Deals, Tasks",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,6 +34,8 @@
34
34
  "./*": "./*"
35
35
  },
36
36
  "scripts": {
37
+ "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
38
+ "publish:pkg:canary": "bun publish:pkg --tag canary",
37
39
  "build": "bun build:bundle && bun build:types",
38
40
  "build:bundle": "tsdown",
39
41
  "build:types": "tsc --noEmit",
@@ -45,18 +47,18 @@
45
47
  "test": "bun run"
46
48
  },
47
49
  "dependencies": {
48
- "@lssm/lib.schema": "workspace:*",
49
- "@lssm/lib.contracts": "workspace:*",
50
- "@lssm/lib.bus": "workspace:*",
51
- "@lssm/lib.identity-rbac": "workspace:*",
52
- "@lssm/lib.jobs": "workspace:*",
53
- "@lssm/module.audit-trail": "workspace:*",
54
- "@lssm/module.notifications": "workspace:*",
50
+ "@lssm/lib.schema": "0.0.0-canary-20251217060433",
51
+ "@lssm/lib.contracts": "0.0.0-canary-20251217060433",
52
+ "@lssm/lib.bus": "0.0.0-canary-20251217060433",
53
+ "@lssm/lib.identity-rbac": "0.0.0-canary-20251217060433",
54
+ "@lssm/lib.jobs": "0.0.0-canary-20251217060433",
55
+ "@lssm/module.audit-trail": "0.0.0-canary-20251217060433",
56
+ "@lssm/module.notifications": "0.0.0-canary-20251217060433",
55
57
  "zod": "^4.1.13"
56
58
  },
57
59
  "devDependencies": {
58
- "@lssm/tool.tsdown": "workspace:*",
59
- "@lssm/tool.typescript": "workspace:*",
60
+ "@lssm/tool.tsdown": "0.0.0-canary-20251217060433",
61
+ "@lssm/tool.typescript": "0.0.0-canary-20251217060433",
60
62
  "tsdown": "^0.17.4",
61
63
  "typescript": "^5.9.3"
62
64
  },