@contractspec/example.learning-journey-crm-onboarding 3.7.17 → 3.7.18
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 +33 -33
- package/CHANGELOG.md +13 -0
- package/dist/browser/docs/crm-onboarding.docblock.js +1 -37
- package/dist/browser/docs/index.js +1 -37
- package/dist/browser/example.js +1 -32
- package/dist/browser/handlers/demo.handlers.js +1 -117
- package/dist/browser/index.js +1 -401
- package/dist/browser/learning-journey-crm-onboarding.feature.js +1 -48
- package/dist/browser/operations/index.js +1 -209
- package/dist/browser/presentations/index.js +1 -256
- package/dist/browser/tests/operations.test-spec.js +1 -34
- package/dist/browser/track.js +1 -95
- package/dist/docs/crm-onboarding.docblock.js +1 -37
- package/dist/docs/index.js +1 -37
- package/dist/example.js +1 -32
- package/dist/handlers/demo.handlers.js +1 -117
- package/dist/index.js +1 -401
- package/dist/learning-journey-crm-onboarding.feature.js +1 -48
- package/dist/node/docs/crm-onboarding.docblock.js +1 -37
- package/dist/node/docs/index.js +1 -37
- package/dist/node/example.js +1 -32
- package/dist/node/handlers/demo.handlers.js +1 -117
- package/dist/node/index.js +1 -401
- package/dist/node/learning-journey-crm-onboarding.feature.js +1 -48
- package/dist/node/operations/index.js +1 -209
- package/dist/node/presentations/index.js +1 -256
- package/dist/node/tests/operations.test-spec.js +1 -34
- package/dist/node/track.js +1 -95
- package/dist/operations/index.js +1 -209
- package/dist/presentations/index.js +1 -256
- package/dist/tests/operations.test-spec.js +1 -34
- package/dist/track.js +1 -95
- package/package.json +7 -7
|
@@ -1,37 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
-
var crmOnboardingDocBlocks = [
|
|
4
|
-
{
|
|
5
|
-
id: "docs.learning-journey.crm-onboarding",
|
|
6
|
-
title: "Learning Journey — CRM First Win",
|
|
7
|
-
summary: "Onboarding track for the CRM Pipeline example that drives users to first closed-won deal.",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/learning-journey/crm-onboarding",
|
|
11
|
-
tags: ["learning", "crm", "onboarding"],
|
|
12
|
-
body: `## Track
|
|
13
|
-
- **Key**: \`crm_first_win\`
|
|
14
|
-
- **Persona**: CRM adopter
|
|
15
|
-
- **Goal**: From empty CRM to first closed-won deal with follow-up
|
|
16
|
-
|
|
17
|
-
## Steps & Events
|
|
18
|
-
1) \`create_pipeline\` → \`pipeline.created\`
|
|
19
|
-
2) \`create_contact_and_company\` → \`contact.created\`
|
|
20
|
-
3) \`create_first_deal\` → \`deal.created\`
|
|
21
|
-
4) \`move_deal_in_pipeline\` → \`deal.moved\`
|
|
22
|
-
5) \`close_deal_won\` → \`deal.won\`
|
|
23
|
-
6) \`setup_follow_up\` → \`task.completed\` (type: follow_up)
|
|
24
|
-
|
|
25
|
-
XP: 15/20/20/20/30/30 with 25 bonus within 72h. Badge: \`crm_first_win\`.
|
|
26
|
-
|
|
27
|
-
## Wiring
|
|
28
|
-
- Depends on \`@contractspec/example.crm-pipeline\` events.
|
|
29
|
-
- Tracks export from \`@contractspec/example.learning-journey-crm-onboarding/track\`.
|
|
30
|
-
- Use onboarding API:
|
|
31
|
-
- \`learning.onboarding.listTracks\`
|
|
32
|
-
- \`learning.onboarding.getProgress\`
|
|
33
|
-
- \`learning.onboarding.recordEvent\` wired from CRM event bus handlers.
|
|
34
|
-
- Surface in CRM dashboard/pipeline UI to guide new users.`
|
|
35
|
-
}
|
|
36
|
-
];
|
|
37
|
-
registerDocBlocks(crmOnboardingDocBlocks);
|
|
1
|
+
import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{id:"docs.learning-journey.crm-onboarding",title:"Learning Journey — CRM First Win",summary:"Onboarding track for the CRM Pipeline example that drives users to first closed-won deal.",kind:"reference",visibility:"public",route:"/docs/learning-journey/crm-onboarding",tags:["learning","crm","onboarding"],body:"## Track\n- **Key**: `crm_first_win`\n- **Persona**: CRM adopter\n- **Goal**: From empty CRM to first closed-won deal with follow-up\n\n## Steps & Events\n1) `create_pipeline` → `pipeline.created`\n2) `create_contact_and_company` → `contact.created`\n3) `create_first_deal` → `deal.created`\n4) `move_deal_in_pipeline` → `deal.moved`\n5) `close_deal_won` → `deal.won`\n6) `setup_follow_up` → `task.completed` (type: follow_up)\n\nXP: 15/20/20/20/30/30 with 25 bonus within 72h. Badge: `crm_first_win`.\n\n## Wiring\n- Depends on `@contractspec/example.crm-pipeline` events.\n- Tracks export from `@contractspec/example.learning-journey-crm-onboarding/track`.\n- Use onboarding API:\n - `learning.onboarding.listTracks`\n - `learning.onboarding.getProgress`\n - `learning.onboarding.recordEvent` wired from CRM event bus handlers.\n- Surface in CRM dashboard/pipeline UI to guide new users."}];f(h);
|
package/dist/node/docs/index.js
CHANGED
|
@@ -1,37 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
-
var crmOnboardingDocBlocks = [
|
|
4
|
-
{
|
|
5
|
-
id: "docs.learning-journey.crm-onboarding",
|
|
6
|
-
title: "Learning Journey — CRM First Win",
|
|
7
|
-
summary: "Onboarding track for the CRM Pipeline example that drives users to first closed-won deal.",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/learning-journey/crm-onboarding",
|
|
11
|
-
tags: ["learning", "crm", "onboarding"],
|
|
12
|
-
body: `## Track
|
|
13
|
-
- **Key**: \`crm_first_win\`
|
|
14
|
-
- **Persona**: CRM adopter
|
|
15
|
-
- **Goal**: From empty CRM to first closed-won deal with follow-up
|
|
16
|
-
|
|
17
|
-
## Steps & Events
|
|
18
|
-
1) \`create_pipeline\` → \`pipeline.created\`
|
|
19
|
-
2) \`create_contact_and_company\` → \`contact.created\`
|
|
20
|
-
3) \`create_first_deal\` → \`deal.created\`
|
|
21
|
-
4) \`move_deal_in_pipeline\` → \`deal.moved\`
|
|
22
|
-
5) \`close_deal_won\` → \`deal.won\`
|
|
23
|
-
6) \`setup_follow_up\` → \`task.completed\` (type: follow_up)
|
|
24
|
-
|
|
25
|
-
XP: 15/20/20/20/30/30 with 25 bonus within 72h. Badge: \`crm_first_win\`.
|
|
26
|
-
|
|
27
|
-
## Wiring
|
|
28
|
-
- Depends on \`@contractspec/example.crm-pipeline\` events.
|
|
29
|
-
- Tracks export from \`@contractspec/example.learning-journey-crm-onboarding/track\`.
|
|
30
|
-
- Use onboarding API:
|
|
31
|
-
- \`learning.onboarding.listTracks\`
|
|
32
|
-
- \`learning.onboarding.getProgress\`
|
|
33
|
-
- \`learning.onboarding.recordEvent\` wired from CRM event bus handlers.
|
|
34
|
-
- Surface in CRM dashboard/pipeline UI to guide new users.`
|
|
35
|
-
}
|
|
36
|
-
];
|
|
37
|
-
registerDocBlocks(crmOnboardingDocBlocks);
|
|
1
|
+
import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{id:"docs.learning-journey.crm-onboarding",title:"Learning Journey — CRM First Win",summary:"Onboarding track for the CRM Pipeline example that drives users to first closed-won deal.",kind:"reference",visibility:"public",route:"/docs/learning-journey/crm-onboarding",tags:["learning","crm","onboarding"],body:"## Track\n- **Key**: `crm_first_win`\n- **Persona**: CRM adopter\n- **Goal**: From empty CRM to first closed-won deal with follow-up\n\n## Steps & Events\n1) `create_pipeline` → `pipeline.created`\n2) `create_contact_and_company` → `contact.created`\n3) `create_first_deal` → `deal.created`\n4) `move_deal_in_pipeline` → `deal.moved`\n5) `close_deal_won` → `deal.won`\n6) `setup_follow_up` → `task.completed` (type: follow_up)\n\nXP: 15/20/20/20/30/30 with 25 bonus within 72h. Badge: `crm_first_win`.\n\n## Wiring\n- Depends on `@contractspec/example.crm-pipeline` events.\n- Tracks export from `@contractspec/example.learning-journey-crm-onboarding/track`.\n- Use onboarding API:\n - `learning.onboarding.listTracks`\n - `learning.onboarding.getProgress`\n - `learning.onboarding.recordEvent` wired from CRM event bus handlers.\n- Surface in CRM dashboard/pipeline UI to guide new users."}];f(h);
|
package/dist/node/example.js
CHANGED
|
@@ -1,32 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
3
|
-
var example = defineExample({
|
|
4
|
-
meta: {
|
|
5
|
-
key: "learning-journey-crm-onboarding",
|
|
6
|
-
version: "1.0.0",
|
|
7
|
-
title: "Learning Journey — CRM First Win",
|
|
8
|
-
description: "Onboarding track for CRM Pipeline driving users from empty CRM to first closed-won deal.",
|
|
9
|
-
kind: "template",
|
|
10
|
-
visibility: "public",
|
|
11
|
-
stability: "experimental",
|
|
12
|
-
owners: ["@platform.core"],
|
|
13
|
-
tags: ["learning", "crm", "onboarding"]
|
|
14
|
-
},
|
|
15
|
-
docs: {
|
|
16
|
-
rootDocId: "docs.learning-journey.crm-onboarding"
|
|
17
|
-
},
|
|
18
|
-
entrypoints: {
|
|
19
|
-
packageName: "@contractspec/example.learning-journey-crm-onboarding",
|
|
20
|
-
docs: "./docs"
|
|
21
|
-
},
|
|
22
|
-
surfaces: {
|
|
23
|
-
templates: true,
|
|
24
|
-
sandbox: { enabled: true, modes: ["playground", "markdown"] },
|
|
25
|
-
studio: { enabled: true, installable: true },
|
|
26
|
-
mcp: { enabled: true }
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
var example_default = example;
|
|
30
|
-
export {
|
|
31
|
-
example_default as default
|
|
32
|
-
};
|
|
1
|
+
import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"learning-journey-crm-onboarding",version:"1.0.0",title:"Learning Journey — CRM First Win",description:"Onboarding track for CRM Pipeline driving users from empty CRM to first closed-won deal.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","crm","onboarding"]},docs:{rootDocId:"docs.learning-journey.crm-onboarding"},entrypoints:{packageName:"@contractspec/example.learning-journey-crm-onboarding",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
|
|
@@ -1,117 +1 @@
|
|
|
1
|
-
|
|
2
|
-
var crmFirstWinTrack = {
|
|
3
|
-
id: "crm_first_win",
|
|
4
|
-
productId: "crm-pipeline",
|
|
5
|
-
name: "CRM First Win",
|
|
6
|
-
description: "Guide a new CRM user from empty pipeline to first closed-won deal.",
|
|
7
|
-
targetUserSegment: "crm_adopter",
|
|
8
|
-
targetRole: "sales",
|
|
9
|
-
totalXp: 135,
|
|
10
|
-
streakRule: { hoursWindow: 72, bonusXp: 25 },
|
|
11
|
-
completionRewards: { xpBonus: 25, badgeKey: "crm_first_win" },
|
|
12
|
-
steps: [
|
|
13
|
-
{
|
|
14
|
-
id: "create_pipeline",
|
|
15
|
-
title: "Create pipeline & stages",
|
|
16
|
-
description: "Create a pipeline with baseline stages.",
|
|
17
|
-
order: 1,
|
|
18
|
-
completion: {
|
|
19
|
-
eventName: "pipeline.created",
|
|
20
|
-
sourceModule: "@contractspec/example.crm-pipeline"
|
|
21
|
-
},
|
|
22
|
-
xpReward: 15,
|
|
23
|
-
metadata: { surface: "pipeline" }
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
id: "create_contact_and_company",
|
|
27
|
-
title: "Create contact and company",
|
|
28
|
-
description: "Add your first contact and associated company.",
|
|
29
|
-
order: 2,
|
|
30
|
-
completion: {
|
|
31
|
-
eventName: "contact.created",
|
|
32
|
-
sourceModule: "@contractspec/example.crm-pipeline"
|
|
33
|
-
},
|
|
34
|
-
xpReward: 20,
|
|
35
|
-
metadata: { surface: "contacts" }
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
id: "create_first_deal",
|
|
39
|
-
title: "Log first deal",
|
|
40
|
-
description: "Create your first deal in the pipeline.",
|
|
41
|
-
order: 3,
|
|
42
|
-
completion: {
|
|
43
|
-
eventName: "deal.created",
|
|
44
|
-
sourceModule: "@contractspec/example.crm-pipeline"
|
|
45
|
-
},
|
|
46
|
-
xpReward: 20,
|
|
47
|
-
metadata: { surface: "deals" }
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
id: "move_deal_in_pipeline",
|
|
51
|
-
title: "Move a deal across stages",
|
|
52
|
-
description: "Move a deal across at least three stages.",
|
|
53
|
-
order: 4,
|
|
54
|
-
completion: {
|
|
55
|
-
eventName: "deal.moved",
|
|
56
|
-
sourceModule: "@contractspec/example.crm-pipeline"
|
|
57
|
-
},
|
|
58
|
-
xpReward: 20,
|
|
59
|
-
metadata: { surface: "deals" }
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
id: "close_deal_won",
|
|
63
|
-
title: "Close a deal as won",
|
|
64
|
-
description: "Close a deal as won to hit first revenue.",
|
|
65
|
-
order: 5,
|
|
66
|
-
completion: {
|
|
67
|
-
eventName: "deal.won",
|
|
68
|
-
sourceModule: "@contractspec/example.crm-pipeline"
|
|
69
|
-
},
|
|
70
|
-
xpReward: 30,
|
|
71
|
-
metadata: { surface: "deals" }
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
id: "setup_follow_up",
|
|
75
|
-
title: "Create follow-up task",
|
|
76
|
-
description: "Create a follow-up task and notification for a contact or deal.",
|
|
77
|
-
order: 6,
|
|
78
|
-
completion: {
|
|
79
|
-
eventName: "task.completed",
|
|
80
|
-
sourceModule: "@contractspec/example.crm-pipeline",
|
|
81
|
-
payloadFilter: { type: "follow_up" }
|
|
82
|
-
},
|
|
83
|
-
xpReward: 30,
|
|
84
|
-
metadata: { surface: "tasks" }
|
|
85
|
-
}
|
|
86
|
-
],
|
|
87
|
-
metadata: {
|
|
88
|
-
surfacedIn: ["crm/dashboard", "crm/pipeline"]
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
var crmLearningTracks = [crmFirstWinTrack];
|
|
92
|
-
|
|
93
|
-
// src/handlers/demo.handlers.ts
|
|
94
|
-
var crmOnboardingEvents = [
|
|
95
|
-
"pipeline.created",
|
|
96
|
-
"contact.created",
|
|
97
|
-
"deal.created",
|
|
98
|
-
"deal.moved",
|
|
99
|
-
"deal.won",
|
|
100
|
-
"task.completed"
|
|
101
|
-
];
|
|
102
|
-
var emitCrmOnboardingEvent = (eventName, { learnerId, occurredAt = new Date, payload }, record) => {
|
|
103
|
-
const event = {
|
|
104
|
-
learnerId,
|
|
105
|
-
name: eventName,
|
|
106
|
-
occurredAt,
|
|
107
|
-
payload,
|
|
108
|
-
trackId: crmFirstWinTrack.id
|
|
109
|
-
};
|
|
110
|
-
return record ? record(event) : event;
|
|
111
|
-
};
|
|
112
|
-
var emitAllCrmOnboardingEvents = (params, record) => crmOnboardingEvents.map((name) => emitCrmOnboardingEvent(name, params, record));
|
|
113
|
-
export {
|
|
114
|
-
emitCrmOnboardingEvent,
|
|
115
|
-
emitAllCrmOnboardingEvents,
|
|
116
|
-
crmOnboardingEvents
|
|
117
|
-
};
|
|
1
|
+
var r={id:"crm_first_win",productId:"crm-pipeline",name:"CRM First Win",description:"Guide a new CRM user from empty pipeline to first closed-won deal.",targetUserSegment:"crm_adopter",targetRole:"sales",totalXp:135,streakRule:{hoursWindow:72,bonusXp:25},completionRewards:{xpBonus:25,badgeKey:"crm_first_win"},steps:[{id:"create_pipeline",title:"Create pipeline & stages",description:"Create a pipeline with baseline stages.",order:1,completion:{eventName:"pipeline.created",sourceModule:"@contractspec/example.crm-pipeline"},xpReward:15,metadata:{surface:"pipeline"}},{id:"create_contact_and_company",title:"Create contact and company",description:"Add your first contact and associated company.",order:2,completion:{eventName:"contact.created",sourceModule:"@contractspec/example.crm-pipeline"},xpReward:20,metadata:{surface:"contacts"}},{id:"create_first_deal",title:"Log first deal",description:"Create your first deal in the pipeline.",order:3,completion:{eventName:"deal.created",sourceModule:"@contractspec/example.crm-pipeline"},xpReward:20,metadata:{surface:"deals"}},{id:"move_deal_in_pipeline",title:"Move a deal across stages",description:"Move a deal across at least three stages.",order:4,completion:{eventName:"deal.moved",sourceModule:"@contractspec/example.crm-pipeline"},xpReward:20,metadata:{surface:"deals"}},{id:"close_deal_won",title:"Close a deal as won",description:"Close a deal as won to hit first revenue.",order:5,completion:{eventName:"deal.won",sourceModule:"@contractspec/example.crm-pipeline"},xpReward:30,metadata:{surface:"deals"}},{id:"setup_follow_up",title:"Create follow-up task",description:"Create a follow-up task and notification for a contact or deal.",order:6,completion:{eventName:"task.completed",sourceModule:"@contractspec/example.crm-pipeline",payloadFilter:{type:"follow_up"}},xpReward:30,metadata:{surface:"tasks"}}],metadata:{surfacedIn:["crm/dashboard","crm/pipeline"]}},p=[r];var i=["pipeline.created","contact.created","deal.created","deal.moved","deal.won","task.completed"],d=(e,{learnerId:t,occurredAt:a=new Date,payload:c},n)=>{let o={learnerId:t,name:e,occurredAt:a,payload:c,trackId:r.id};return n?n(o):o},m=(e,t)=>i.map((a)=>d(a,e,t));export{d as emitCrmOnboardingEvent,m as emitAllCrmOnboardingEvents,i as crmOnboardingEvents};
|
package/dist/node/index.js
CHANGED
|
@@ -1,401 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
-
var crmOnboardingDocBlocks = [
|
|
4
|
-
{
|
|
5
|
-
id: "docs.learning-journey.crm-onboarding",
|
|
6
|
-
title: "Learning Journey — CRM First Win",
|
|
7
|
-
summary: "Onboarding track for the CRM Pipeline example that drives users to first closed-won deal.",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/learning-journey/crm-onboarding",
|
|
11
|
-
tags: ["learning", "crm", "onboarding"],
|
|
12
|
-
body: `## Track
|
|
13
|
-
- **Key**: \`crm_first_win\`
|
|
14
|
-
- **Persona**: CRM adopter
|
|
15
|
-
- **Goal**: From empty CRM to first closed-won deal with follow-up
|
|
16
|
-
|
|
17
|
-
## Steps & Events
|
|
18
|
-
1) \`create_pipeline\` → \`pipeline.created\`
|
|
19
|
-
2) \`create_contact_and_company\` → \`contact.created\`
|
|
20
|
-
3) \`create_first_deal\` → \`deal.created\`
|
|
21
|
-
4) \`move_deal_in_pipeline\` → \`deal.moved\`
|
|
22
|
-
5) \`close_deal_won\` → \`deal.won\`
|
|
23
|
-
6) \`setup_follow_up\` → \`task.completed\` (type: follow_up)
|
|
24
|
-
|
|
25
|
-
XP: 15/20/20/20/30/30 with 25 bonus within 72h. Badge: \`crm_first_win\`.
|
|
26
|
-
|
|
27
|
-
## Wiring
|
|
28
|
-
- Depends on \`@contractspec/example.crm-pipeline\` events.
|
|
29
|
-
- Tracks export from \`@contractspec/example.learning-journey-crm-onboarding/track\`.
|
|
30
|
-
- Use onboarding API:
|
|
31
|
-
- \`learning.onboarding.listTracks\`
|
|
32
|
-
- \`learning.onboarding.getProgress\`
|
|
33
|
-
- \`learning.onboarding.recordEvent\` wired from CRM event bus handlers.
|
|
34
|
-
- Surface in CRM dashboard/pipeline UI to guide new users.`
|
|
35
|
-
}
|
|
36
|
-
];
|
|
37
|
-
registerDocBlocks(crmOnboardingDocBlocks);
|
|
38
|
-
// src/example.ts
|
|
39
|
-
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
40
|
-
var example = defineExample({
|
|
41
|
-
meta: {
|
|
42
|
-
key: "learning-journey-crm-onboarding",
|
|
43
|
-
version: "1.0.0",
|
|
44
|
-
title: "Learning Journey — CRM First Win",
|
|
45
|
-
description: "Onboarding track for CRM Pipeline driving users from empty CRM to first closed-won deal.",
|
|
46
|
-
kind: "template",
|
|
47
|
-
visibility: "public",
|
|
48
|
-
stability: "experimental",
|
|
49
|
-
owners: ["@platform.core"],
|
|
50
|
-
tags: ["learning", "crm", "onboarding"]
|
|
51
|
-
},
|
|
52
|
-
docs: {
|
|
53
|
-
rootDocId: "docs.learning-journey.crm-onboarding"
|
|
54
|
-
},
|
|
55
|
-
entrypoints: {
|
|
56
|
-
packageName: "@contractspec/example.learning-journey-crm-onboarding",
|
|
57
|
-
docs: "./docs"
|
|
58
|
-
},
|
|
59
|
-
surfaces: {
|
|
60
|
-
templates: true,
|
|
61
|
-
sandbox: { enabled: true, modes: ["playground", "markdown"] },
|
|
62
|
-
studio: { enabled: true, installable: true },
|
|
63
|
-
mcp: { enabled: true }
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
var example_default = example;
|
|
67
|
-
|
|
68
|
-
// src/track.ts
|
|
69
|
-
var crmFirstWinTrack = {
|
|
70
|
-
id: "crm_first_win",
|
|
71
|
-
productId: "crm-pipeline",
|
|
72
|
-
name: "CRM First Win",
|
|
73
|
-
description: "Guide a new CRM user from empty pipeline to first closed-won deal.",
|
|
74
|
-
targetUserSegment: "crm_adopter",
|
|
75
|
-
targetRole: "sales",
|
|
76
|
-
totalXp: 135,
|
|
77
|
-
streakRule: { hoursWindow: 72, bonusXp: 25 },
|
|
78
|
-
completionRewards: { xpBonus: 25, badgeKey: "crm_first_win" },
|
|
79
|
-
steps: [
|
|
80
|
-
{
|
|
81
|
-
id: "create_pipeline",
|
|
82
|
-
title: "Create pipeline & stages",
|
|
83
|
-
description: "Create a pipeline with baseline stages.",
|
|
84
|
-
order: 1,
|
|
85
|
-
completion: {
|
|
86
|
-
eventName: "pipeline.created",
|
|
87
|
-
sourceModule: "@contractspec/example.crm-pipeline"
|
|
88
|
-
},
|
|
89
|
-
xpReward: 15,
|
|
90
|
-
metadata: { surface: "pipeline" }
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
id: "create_contact_and_company",
|
|
94
|
-
title: "Create contact and company",
|
|
95
|
-
description: "Add your first contact and associated company.",
|
|
96
|
-
order: 2,
|
|
97
|
-
completion: {
|
|
98
|
-
eventName: "contact.created",
|
|
99
|
-
sourceModule: "@contractspec/example.crm-pipeline"
|
|
100
|
-
},
|
|
101
|
-
xpReward: 20,
|
|
102
|
-
metadata: { surface: "contacts" }
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
id: "create_first_deal",
|
|
106
|
-
title: "Log first deal",
|
|
107
|
-
description: "Create your first deal in the pipeline.",
|
|
108
|
-
order: 3,
|
|
109
|
-
completion: {
|
|
110
|
-
eventName: "deal.created",
|
|
111
|
-
sourceModule: "@contractspec/example.crm-pipeline"
|
|
112
|
-
},
|
|
113
|
-
xpReward: 20,
|
|
114
|
-
metadata: { surface: "deals" }
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
id: "move_deal_in_pipeline",
|
|
118
|
-
title: "Move a deal across stages",
|
|
119
|
-
description: "Move a deal across at least three stages.",
|
|
120
|
-
order: 4,
|
|
121
|
-
completion: {
|
|
122
|
-
eventName: "deal.moved",
|
|
123
|
-
sourceModule: "@contractspec/example.crm-pipeline"
|
|
124
|
-
},
|
|
125
|
-
xpReward: 20,
|
|
126
|
-
metadata: { surface: "deals" }
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
id: "close_deal_won",
|
|
130
|
-
title: "Close a deal as won",
|
|
131
|
-
description: "Close a deal as won to hit first revenue.",
|
|
132
|
-
order: 5,
|
|
133
|
-
completion: {
|
|
134
|
-
eventName: "deal.won",
|
|
135
|
-
sourceModule: "@contractspec/example.crm-pipeline"
|
|
136
|
-
},
|
|
137
|
-
xpReward: 30,
|
|
138
|
-
metadata: { surface: "deals" }
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
id: "setup_follow_up",
|
|
142
|
-
title: "Create follow-up task",
|
|
143
|
-
description: "Create a follow-up task and notification for a contact or deal.",
|
|
144
|
-
order: 6,
|
|
145
|
-
completion: {
|
|
146
|
-
eventName: "task.completed",
|
|
147
|
-
sourceModule: "@contractspec/example.crm-pipeline",
|
|
148
|
-
payloadFilter: { type: "follow_up" }
|
|
149
|
-
},
|
|
150
|
-
xpReward: 30,
|
|
151
|
-
metadata: { surface: "tasks" }
|
|
152
|
-
}
|
|
153
|
-
],
|
|
154
|
-
metadata: {
|
|
155
|
-
surfacedIn: ["crm/dashboard", "crm/pipeline"]
|
|
156
|
-
}
|
|
157
|
-
};
|
|
158
|
-
var crmLearningTracks = [crmFirstWinTrack];
|
|
159
|
-
|
|
160
|
-
// src/handlers/demo.handlers.ts
|
|
161
|
-
var crmOnboardingEvents = [
|
|
162
|
-
"pipeline.created",
|
|
163
|
-
"contact.created",
|
|
164
|
-
"deal.created",
|
|
165
|
-
"deal.moved",
|
|
166
|
-
"deal.won",
|
|
167
|
-
"task.completed"
|
|
168
|
-
];
|
|
169
|
-
var emitCrmOnboardingEvent = (eventName, { learnerId, occurredAt = new Date, payload }, record) => {
|
|
170
|
-
const event = {
|
|
171
|
-
learnerId,
|
|
172
|
-
name: eventName,
|
|
173
|
-
occurredAt,
|
|
174
|
-
payload,
|
|
175
|
-
trackId: crmFirstWinTrack.id
|
|
176
|
-
};
|
|
177
|
-
return record ? record(event) : event;
|
|
178
|
-
};
|
|
179
|
-
var emitAllCrmOnboardingEvents = (params, record) => crmOnboardingEvents.map((name) => emitCrmOnboardingEvent(name, params, record));
|
|
180
|
-
|
|
181
|
-
// src/learning-journey-crm-onboarding.feature.ts
|
|
182
|
-
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
183
|
-
var LearningJourneyCrmOnboardingFeature = defineFeature({
|
|
184
|
-
meta: {
|
|
185
|
-
key: "learning-journey-crm-onboarding",
|
|
186
|
-
title: "Learning Journey: CRM Onboarding",
|
|
187
|
-
description: "CRM first-win onboarding journey with step-by-step guidance for new CRM users",
|
|
188
|
-
domain: "learning-journey",
|
|
189
|
-
owners: ["@examples.learning-journey.crm-onboarding"],
|
|
190
|
-
tags: ["learning", "crm", "onboarding", "journey"],
|
|
191
|
-
stability: "experimental",
|
|
192
|
-
version: "1.0.0"
|
|
193
|
-
},
|
|
194
|
-
operations: [
|
|
195
|
-
{ key: "learningJourney.crmOnboarding.recordEvent", version: "1.0.0" },
|
|
196
|
-
{ key: "learningJourney.crmOnboarding.getTrack", version: "1.0.0" }
|
|
197
|
-
],
|
|
198
|
-
events: [],
|
|
199
|
-
presentations: [
|
|
200
|
-
{ key: "learning.journey.crm.track", version: "1.0.0" },
|
|
201
|
-
{ key: "learning.journey.crm.widget", version: "1.0.0" }
|
|
202
|
-
],
|
|
203
|
-
opToPresentation: [
|
|
204
|
-
{
|
|
205
|
-
op: { key: "learningJourney.crmOnboarding.getTrack", version: "1.0.0" },
|
|
206
|
-
pres: { key: "learning.journey.crm.track", version: "1.0.0" }
|
|
207
|
-
}
|
|
208
|
-
],
|
|
209
|
-
presentationsTargets: [
|
|
210
|
-
{
|
|
211
|
-
key: "learning.journey.crm.track",
|
|
212
|
-
version: "1.0.0",
|
|
213
|
-
targets: ["react", "markdown", "application/json"]
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
key: "learning.journey.crm.widget",
|
|
217
|
-
version: "1.0.0",
|
|
218
|
-
targets: ["react"]
|
|
219
|
-
}
|
|
220
|
-
],
|
|
221
|
-
capabilities: {
|
|
222
|
-
requires: [{ key: "identity", version: "1.0.0" }]
|
|
223
|
-
},
|
|
224
|
-
docs: ["docs.learning-journey.crm-onboarding"]
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
// src/operations/index.ts
|
|
228
|
-
import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
|
|
229
|
-
import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
|
|
230
|
-
var OWNERS = ["examples.learning-journey.crm-onboarding"];
|
|
231
|
-
var StepModel = defineSchemaModel({
|
|
232
|
-
name: "CrmOnboardingStep",
|
|
233
|
-
description: "Step metadata for CRM first win journey",
|
|
234
|
-
fields: {
|
|
235
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
236
|
-
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
237
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
238
|
-
completionEvent: {
|
|
239
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
240
|
-
isOptional: false
|
|
241
|
-
},
|
|
242
|
-
sourceModule: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
243
|
-
xpReward: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
244
|
-
order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true }
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
var CrmOnboardingTrackModel = defineSchemaModel({
|
|
248
|
-
name: "CrmOnboardingTrack",
|
|
249
|
-
description: "CRM onboarding track definition",
|
|
250
|
-
fields: {
|
|
251
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
252
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
253
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
254
|
-
totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
255
|
-
completionXpBonus: {
|
|
256
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
257
|
-
isOptional: true
|
|
258
|
-
},
|
|
259
|
-
completionBadgeKey: {
|
|
260
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
261
|
-
isOptional: true
|
|
262
|
-
},
|
|
263
|
-
streakHoursWindow: {
|
|
264
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
265
|
-
isOptional: true
|
|
266
|
-
},
|
|
267
|
-
streakBonusXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
268
|
-
steps: { type: StepModel, isArray: true, isOptional: false }
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
var TrackResponseModel = defineSchemaModel({
|
|
272
|
-
name: "CrmOnboardingTrackResponse",
|
|
273
|
-
description: "Response wrapper for CRM onboarding track",
|
|
274
|
-
fields: {
|
|
275
|
-
track: { type: CrmOnboardingTrackModel, isOptional: false }
|
|
276
|
-
}
|
|
277
|
-
});
|
|
278
|
-
var RecordDemoEventInput = defineSchemaModel({
|
|
279
|
-
name: "CrmOnboardingRecordEventInput",
|
|
280
|
-
description: "Emit a demo event to advance CRM onboarding steps",
|
|
281
|
-
fields: {
|
|
282
|
-
learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
283
|
-
eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
284
|
-
payload: { type: ScalarTypeEnum.JSON(), isOptional: true },
|
|
285
|
-
occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
var SuccessModel = defineSchemaModel({
|
|
289
|
-
name: "CrmOnboardingSuccess",
|
|
290
|
-
description: "Generic success response",
|
|
291
|
-
fields: {
|
|
292
|
-
success: { type: ScalarTypeEnum.Boolean(), isOptional: false }
|
|
293
|
-
}
|
|
294
|
-
});
|
|
295
|
-
var GetCrmOnboardingTrack = defineQuery({
|
|
296
|
-
meta: {
|
|
297
|
-
key: "learningJourney.crmOnboarding.getTrack",
|
|
298
|
-
version: "1.0.0",
|
|
299
|
-
stability: "experimental",
|
|
300
|
-
owners: [...OWNERS],
|
|
301
|
-
tags: ["learning", "crm", "onboarding"],
|
|
302
|
-
description: "Fetch CRM first win track definition.",
|
|
303
|
-
goal: "Expose track metadata to UIs and templates.",
|
|
304
|
-
context: "Called by Studio/Playground to render journey steps."
|
|
305
|
-
},
|
|
306
|
-
io: {
|
|
307
|
-
input: defineSchemaModel({
|
|
308
|
-
name: "CrmOnboardingTrackInput",
|
|
309
|
-
description: "Track input",
|
|
310
|
-
fields: {}
|
|
311
|
-
}),
|
|
312
|
-
output: TrackResponseModel
|
|
313
|
-
},
|
|
314
|
-
policy: { auth: "user" }
|
|
315
|
-
});
|
|
316
|
-
var RecordCrmOnboardingEvent = defineCommand({
|
|
317
|
-
meta: {
|
|
318
|
-
key: "learningJourney.crmOnboarding.recordEvent",
|
|
319
|
-
version: "1.0.0",
|
|
320
|
-
stability: "experimental",
|
|
321
|
-
owners: [...OWNERS],
|
|
322
|
-
tags: ["learning", "crm", "onboarding"],
|
|
323
|
-
description: "Record an event to advance CRM onboarding progress.",
|
|
324
|
-
goal: "Advance steps via domain events in demo/sandbox contexts.",
|
|
325
|
-
context: "Called by handlers or demo scripts to emit step completion events."
|
|
326
|
-
},
|
|
327
|
-
io: {
|
|
328
|
-
input: RecordDemoEventInput,
|
|
329
|
-
output: SuccessModel
|
|
330
|
-
},
|
|
331
|
-
policy: { auth: "user" }
|
|
332
|
-
});
|
|
333
|
-
var crmOnboardingContracts = {
|
|
334
|
-
GetCrmOnboardingTrack,
|
|
335
|
-
RecordCrmOnboardingEvent,
|
|
336
|
-
track: crmFirstWinTrack
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
// src/presentations/index.ts
|
|
340
|
-
import {
|
|
341
|
-
definePresentation,
|
|
342
|
-
StabilityEnum
|
|
343
|
-
} from "@contractspec/lib.contracts-spec";
|
|
344
|
-
var baseMeta = {
|
|
345
|
-
domain: "learning-journey",
|
|
346
|
-
title: "CRM Onboarding",
|
|
347
|
-
owners: ["@examples.learning-journey.crm-onboarding"],
|
|
348
|
-
tags: ["learning", "crm", "onboarding"],
|
|
349
|
-
stability: StabilityEnum.Experimental,
|
|
350
|
-
goal: "Guide CRM users through onboarding",
|
|
351
|
-
context: "CRM onboarding journey"
|
|
352
|
-
};
|
|
353
|
-
var CrmOnboardingTrackPresentation = definePresentation({
|
|
354
|
-
meta: {
|
|
355
|
-
key: "learning.journey.crm.track",
|
|
356
|
-
version: "1.0.0",
|
|
357
|
-
description: "CRM first win track detail",
|
|
358
|
-
...baseMeta
|
|
359
|
-
},
|
|
360
|
-
source: {
|
|
361
|
-
type: "component",
|
|
362
|
-
framework: "react",
|
|
363
|
-
componentKey: "LearningTrackDetail",
|
|
364
|
-
props: CrmOnboardingTrackModel
|
|
365
|
-
},
|
|
366
|
-
targets: ["react", "markdown", "application/json"]
|
|
367
|
-
});
|
|
368
|
-
var CrmOnboardingWidgetPresentation = definePresentation({
|
|
369
|
-
meta: {
|
|
370
|
-
key: "learning.journey.crm.widget",
|
|
371
|
-
version: "1.0.0",
|
|
372
|
-
description: "Compact widget for CRM onboarding progress",
|
|
373
|
-
...baseMeta
|
|
374
|
-
},
|
|
375
|
-
source: {
|
|
376
|
-
type: "component",
|
|
377
|
-
framework: "react",
|
|
378
|
-
componentKey: "LearningTrackProgressWidget"
|
|
379
|
-
},
|
|
380
|
-
targets: ["react"]
|
|
381
|
-
});
|
|
382
|
-
var crmOnboardingPresentations = [
|
|
383
|
-
CrmOnboardingTrackPresentation,
|
|
384
|
-
CrmOnboardingWidgetPresentation
|
|
385
|
-
];
|
|
386
|
-
export {
|
|
387
|
-
example_default as example,
|
|
388
|
-
emitCrmOnboardingEvent,
|
|
389
|
-
emitAllCrmOnboardingEvents,
|
|
390
|
-
crmOnboardingPresentations,
|
|
391
|
-
crmOnboardingEvents,
|
|
392
|
-
crmOnboardingContracts,
|
|
393
|
-
crmLearningTracks,
|
|
394
|
-
crmFirstWinTrack,
|
|
395
|
-
RecordCrmOnboardingEvent,
|
|
396
|
-
LearningJourneyCrmOnboardingFeature,
|
|
397
|
-
GetCrmOnboardingTrack,
|
|
398
|
-
CrmOnboardingWidgetPresentation,
|
|
399
|
-
CrmOnboardingTrackPresentation,
|
|
400
|
-
CrmOnboardingTrackModel
|
|
401
|
-
};
|
|
1
|
+
import{registerDocBlocks as w}from"@contractspec/lib.contracts-spec/docs";var v=[{id:"docs.learning-journey.crm-onboarding",title:"Learning Journey — CRM First Win",summary:"Onboarding track for the CRM Pipeline example that drives users to first closed-won deal.",kind:"reference",visibility:"public",route:"/docs/learning-journey/crm-onboarding",tags:["learning","crm","onboarding"],body:"## Track\n- **Key**: `crm_first_win`\n- **Persona**: CRM adopter\n- **Goal**: From empty CRM to first closed-won deal with follow-up\n\n## Steps & Events\n1) `create_pipeline` → `pipeline.created`\n2) `create_contact_and_company` → `contact.created`\n3) `create_first_deal` → `deal.created`\n4) `move_deal_in_pipeline` → `deal.moved`\n5) `close_deal_won` → `deal.won`\n6) `setup_follow_up` → `task.completed` (type: follow_up)\n\nXP: 15/20/20/20/30/30 with 25 bonus within 72h. Badge: `crm_first_win`.\n\n## Wiring\n- Depends on `@contractspec/example.crm-pipeline` events.\n- Tracks export from `@contractspec/example.learning-journey-crm-onboarding/track`.\n- Use onboarding API:\n - `learning.onboarding.listTracks`\n - `learning.onboarding.getProgress`\n - `learning.onboarding.recordEvent` wired from CRM event bus handlers.\n- Surface in CRM dashboard/pipeline UI to guide new users."}];w(v);import{defineExample as u}from"@contractspec/lib.contracts-spec";var _=u({meta:{key:"learning-journey-crm-onboarding",version:"1.0.0",title:"Learning Journey — CRM First Win",description:"Onboarding track for CRM Pipeline driving users from empty CRM to first closed-won deal.",kind:"template",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["learning","crm","onboarding"]},docs:{rootDocId:"docs.learning-journey.crm-onboarding"},entrypoints:{packageName:"@contractspec/example.learning-journey-crm-onboarding",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),x=_;var r={id:"crm_first_win",productId:"crm-pipeline",name:"CRM First Win",description:"Guide a new CRM user from empty pipeline to first closed-won deal.",targetUserSegment:"crm_adopter",targetRole:"sales",totalXp:135,streakRule:{hoursWindow:72,bonusXp:25},completionRewards:{xpBonus:25,badgeKey:"crm_first_win"},steps:[{id:"create_pipeline",title:"Create pipeline & stages",description:"Create a pipeline with baseline stages.",order:1,completion:{eventName:"pipeline.created",sourceModule:"@contractspec/example.crm-pipeline"},xpReward:15,metadata:{surface:"pipeline"}},{id:"create_contact_and_company",title:"Create contact and company",description:"Add your first contact and associated company.",order:2,completion:{eventName:"contact.created",sourceModule:"@contractspec/example.crm-pipeline"},xpReward:20,metadata:{surface:"contacts"}},{id:"create_first_deal",title:"Log first deal",description:"Create your first deal in the pipeline.",order:3,completion:{eventName:"deal.created",sourceModule:"@contractspec/example.crm-pipeline"},xpReward:20,metadata:{surface:"deals"}},{id:"move_deal_in_pipeline",title:"Move a deal across stages",description:"Move a deal across at least three stages.",order:4,completion:{eventName:"deal.moved",sourceModule:"@contractspec/example.crm-pipeline"},xpReward:20,metadata:{surface:"deals"}},{id:"close_deal_won",title:"Close a deal as won",description:"Close a deal as won to hit first revenue.",order:5,completion:{eventName:"deal.won",sourceModule:"@contractspec/example.crm-pipeline"},xpReward:30,metadata:{surface:"deals"}},{id:"setup_follow_up",title:"Create follow-up task",description:"Create a follow-up task and notification for a contact or deal.",order:6,completion:{eventName:"task.completed",sourceModule:"@contractspec/example.crm-pipeline",payloadFilter:{type:"follow_up"}},xpReward:30,metadata:{surface:"tasks"}}],metadata:{surfacedIn:["crm/dashboard","crm/pipeline"]}},G=[r];var g=["pipeline.created","contact.created","deal.created","deal.moved","deal.won","task.completed"],f=(o,{learnerId:a,occurredAt:i=new Date,payload:m},d)=>{let s={learnerId:a,name:o,occurredAt:i,payload:m,trackId:r.id};return d?d(s):s},W=(o,a)=>g.map((i)=>f(i,o,a));import{defineFeature as R}from"@contractspec/lib.contracts-spec";var $=R({meta:{key:"learning-journey-crm-onboarding",title:"Learning Journey: CRM Onboarding",description:"CRM first-win onboarding journey with step-by-step guidance for new CRM users",domain:"learning-journey",owners:["@examples.learning-journey.crm-onboarding"],tags:["learning","crm","onboarding","journey"],stability:"experimental",version:"1.0.0"},operations:[{key:"learningJourney.crmOnboarding.recordEvent",version:"1.0.0"},{key:"learningJourney.crmOnboarding.getTrack",version:"1.0.0"}],events:[],presentations:[{key:"learning.journey.crm.track",version:"1.0.0"},{key:"learning.journey.crm.widget",version:"1.0.0"}],opToPresentation:[{op:{key:"learningJourney.crmOnboarding.getTrack",version:"1.0.0"},pres:{key:"learning.journey.crm.track",version:"1.0.0"}}],presentationsTargets:[{key:"learning.journey.crm.track",version:"1.0.0",targets:["react","markdown","application/json"]},{key:"learning.journey.crm.widget",version:"1.0.0",targets:["react"]}],capabilities:{requires:[{key:"identity",version:"1.0.0"}]},docs:["docs.learning-journey.crm-onboarding"]});import{defineCommand as k,defineQuery as L}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as t,ScalarTypeEnum as e}from"@contractspec/lib.schema";var p=["examples.learning-journey.crm-onboarding"],C=t({name:"CrmOnboardingStep",description:"Step metadata for CRM first win journey",fields:{id:{type:e.String_unsecure(),isOptional:!1},title:{type:e.String_unsecure(),isOptional:!1},description:{type:e.String_unsecure(),isOptional:!0},completionEvent:{type:e.String_unsecure(),isOptional:!1},sourceModule:{type:e.String_unsecure(),isOptional:!0},xpReward:{type:e.Int_unsecure(),isOptional:!0},order:{type:e.Int_unsecure(),isOptional:!0}}}),n=t({name:"CrmOnboardingTrack",description:"CRM onboarding track definition",fields:{id:{type:e.String_unsecure(),isOptional:!1},name:{type:e.String_unsecure(),isOptional:!1},description:{type:e.String_unsecure(),isOptional:!0},totalXp:{type:e.Int_unsecure(),isOptional:!0},completionXpBonus:{type:e.Int_unsecure(),isOptional:!0},completionBadgeKey:{type:e.String_unsecure(),isOptional:!0},streakHoursWindow:{type:e.Int_unsecure(),isOptional:!0},streakBonusXp:{type:e.Int_unsecure(),isOptional:!0},steps:{type:C,isArray:!0,isOptional:!1}}}),J=t({name:"CrmOnboardingTrackResponse",description:"Response wrapper for CRM onboarding track",fields:{track:{type:n,isOptional:!1}}}),I=t({name:"CrmOnboardingRecordEventInput",description:"Emit a demo event to advance CRM onboarding steps",fields:{learnerId:{type:e.String_unsecure(),isOptional:!1},eventName:{type:e.String_unsecure(),isOptional:!1},payload:{type:e.JSON(),isOptional:!0},occurredAt:{type:e.DateTime(),isOptional:!0}}}),A=t({name:"CrmOnboardingSuccess",description:"Generic success response",fields:{success:{type:e.Boolean(),isOptional:!1}}}),N=L({meta:{key:"learningJourney.crmOnboarding.getTrack",version:"1.0.0",stability:"experimental",owners:[...p],tags:["learning","crm","onboarding"],description:"Fetch CRM first win track definition.",goal:"Expose track metadata to UIs and templates.",context:"Called by Studio/Playground to render journey steps."},io:{input:t({name:"CrmOnboardingTrackInput",description:"Track input",fields:{}}),output:J},policy:{auth:"user"}}),F=k({meta:{key:"learningJourney.crmOnboarding.recordEvent",version:"1.0.0",stability:"experimental",owners:[...p],tags:["learning","crm","onboarding"],description:"Record an event to advance CRM onboarding progress.",goal:"Advance steps via domain events in demo/sandbox contexts.",context:"Called by handlers or demo scripts to emit step completion events."},io:{input:I,output:A},policy:{auth:"user"}}),Q={GetCrmOnboardingTrack:N,RecordCrmOnboardingEvent:F,track:r};import{definePresentation as c,StabilityEnum as X}from"@contractspec/lib.contracts-spec";var l={domain:"learning-journey",title:"CRM Onboarding",owners:["@examples.learning-journey.crm-onboarding"],tags:["learning","crm","onboarding"],stability:X.Experimental,goal:"Guide CRM users through onboarding",context:"CRM onboarding journey"},K=c({meta:{key:"learning.journey.crm.track",version:"1.0.0",description:"CRM first win track detail",...l},source:{type:"component",framework:"react",componentKey:"LearningTrackDetail",props:n},targets:["react","markdown","application/json"]}),U=c({meta:{key:"learning.journey.crm.widget",version:"1.0.0",description:"Compact widget for CRM onboarding progress",...l},source:{type:"component",framework:"react",componentKey:"LearningTrackProgressWidget"},targets:["react"]}),E=[K,U];export{x as example,f as emitCrmOnboardingEvent,W as emitAllCrmOnboardingEvents,E as crmOnboardingPresentations,g as crmOnboardingEvents,Q as crmOnboardingContracts,G as crmLearningTracks,r as crmFirstWinTrack,F as RecordCrmOnboardingEvent,$ as LearningJourneyCrmOnboardingFeature,N as GetCrmOnboardingTrack,U as CrmOnboardingWidgetPresentation,K as CrmOnboardingTrackPresentation,n as CrmOnboardingTrackModel};
|