@contractspec/example.learning-journey-crm-onboarding 3.7.18 → 4.0.0
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 +18 -18
- package/CHANGELOG.md +30 -0
- package/dist/browser/docs/crm-onboarding.docblock.js +1 -1
- package/dist/browser/docs/index.js +1 -1
- package/dist/browser/handlers/demo.handlers.js +1 -1
- package/dist/browser/index.js +1 -1
- package/dist/browser/operations/index.js +1 -1
- package/dist/browser/presentations/index.js +1 -1
- package/dist/browser/track.js +1 -1
- package/dist/docs/crm-onboarding.docblock.js +1 -1
- package/dist/docs/index.js +1 -1
- package/dist/handlers/demo.handlers.js +1 -1
- package/dist/index.js +1 -1
- package/dist/node/docs/crm-onboarding.docblock.js +1 -1
- package/dist/node/docs/index.js +1 -1
- package/dist/node/handlers/demo.handlers.js +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/operations/index.js +1 -1
- package/dist/node/presentations/index.js +1 -1
- package/dist/node/track.js +1 -1
- package/dist/operations/index.d.ts +443 -38
- package/dist/operations/index.js +1 -1
- package/dist/presentations/index.js +1 -1
- package/dist/track.d.ts +3 -3
- package/dist/track.js +1 -1
- package/package.json +4 -4
- package/src/docs/crm-onboarding.docblock.ts +4 -4
- package/src/operations/index.ts +3 -43
- package/src/presentations/index.ts +2 -2
- package/src/track.ts +13 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
2
|
+
var a={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:{xp: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,prerequisites:[{kind:"step_completed",stepId:"create_pipeline"}],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,prerequisites:[{kind:"step_completed",stepId:"create_contact_and_company"}],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,prerequisites:[{kind:"step_completed",stepId:"create_first_deal"}],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,prerequisites:[{kind:"step_completed",stepId:"move_deal_in_pipeline"}],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,prerequisites:[{kind:"step_completed",stepId:"close_deal_won"}],completion:{eventName:"task.completed",sourceModule:"@contractspec/example.crm-pipeline",payloadFilter:{type:"follow_up"}},xpReward:30,metadata:{surface:"tasks"}}],metadata:{surfacedIn:["crm/dashboard","crm/pipeline"]}},v=[a];import{defineCommand as o,defineQuery as c}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as t,ScalarTypeEnum as e}from"@contractspec/lib.schema";import{JourneyTrackModel as d}from"@contractspec/module.learning-journey/contracts/journey";var i=["examples.learning-journey.crm-onboarding"],p=d,l=t({name:"CrmOnboardingTrackResponse",description:"Response wrapper for CRM onboarding track",fields:{track:{type:p,isOptional:!1}}}),n=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}}}),m=t({name:"CrmOnboardingSuccess",description:"Generic success response",fields:{success:{type:e.Boolean(),isOptional:!1}}}),_=c({meta:{key:"learningJourney.crmOnboarding.getTrack",version:"1.0.0",stability:"experimental",owners:[...i],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:l},policy:{auth:"user"}}),u=o({meta:{key:"learningJourney.crmOnboarding.recordEvent",version:"1.0.0",stability:"experimental",owners:[...i],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:n,output:m},policy:{auth:"user"}}),N={GetCrmOnboardingTrack:_,RecordCrmOnboardingEvent:u,track:a};import{definePresentation as s,StabilityEnum as w}from"@contractspec/lib.contracts-spec";var r={domain:"learning-journey",title:"CRM Onboarding",owners:["@examples.learning-journey.crm-onboarding"],tags:["learning","crm","onboarding"],stability:w.Experimental,goal:"Guide CRM users through onboarding",context:"CRM onboarding journey"},f=s({meta:{key:"learning.journey.crm.track",version:"1.0.0",description:"CRM first win track detail",...r},source:{type:"component",framework:"react",componentKey:"LearningTrackDetail",props:p},targets:["react","markdown","application/json"]}),x=s({meta:{key:"learning.journey.crm.widget",version:"1.0.0",description:"Compact widget for CRM onboarding progress",...r},source:{type:"component",framework:"react",componentKey:"LearningTrackProgressWidget"},targets:["react"]}),F=[f,x];export{F as crmOnboardingPresentations,x as CrmOnboardingWidgetPresentation,f as CrmOnboardingTrackPresentation};
|
package/dist/track.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const crmFirstWinTrack:
|
|
3
|
-
export declare const crmLearningTracks:
|
|
1
|
+
import type { JourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
|
|
2
|
+
export declare const crmFirstWinTrack: JourneyTrackSpec;
|
|
3
|
+
export declare const crmLearningTracks: JourneyTrackSpec[];
|
package/dist/track.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var e={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:{
|
|
2
|
+
var e={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:{xp: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,prerequisites:[{kind:"step_completed",stepId:"create_pipeline"}],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,prerequisites:[{kind:"step_completed",stepId:"create_contact_and_company"}],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,prerequisites:[{kind:"step_completed",stepId:"create_first_deal"}],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,prerequisites:[{kind:"step_completed",stepId:"move_deal_in_pipeline"}],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,prerequisites:[{kind:"step_completed",stepId:"close_deal_won"}],completion:{eventName:"task.completed",sourceModule:"@contractspec/example.crm-pipeline",payloadFilter:{type:"follow_up"}},xpReward:30,metadata:{surface:"tasks"}}],metadata:{surfacedIn:["crm/dashboard","crm/pipeline"]}},t=[e];export{t as crmLearningTracks,e as crmFirstWinTrack};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.learning-journey-crm-onboarding",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Learning journey track that onboards users to the CRM pipeline example.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -91,10 +91,10 @@
|
|
|
91
91
|
"typecheck": "tsc --noEmit"
|
|
92
92
|
},
|
|
93
93
|
"dependencies": {
|
|
94
|
-
"@contractspec/lib.contracts-spec": "5.
|
|
94
|
+
"@contractspec/lib.contracts-spec": "5.4.0",
|
|
95
95
|
"@contractspec/lib.schema": "3.7.14",
|
|
96
|
-
"@contractspec/module.learning-journey": "
|
|
97
|
-
"@contractspec/example.crm-pipeline": "3.7.
|
|
96
|
+
"@contractspec/module.learning-journey": "4.0.0",
|
|
97
|
+
"@contractspec/example.crm-pipeline": "3.7.20"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
100
100
|
"@contractspec/tool.typescript": "3.7.13",
|
|
@@ -29,10 +29,10 @@ XP: 15/20/20/20/30/30 with 25 bonus within 72h. Badge: \`crm_first_win\`.
|
|
|
29
29
|
## Wiring
|
|
30
30
|
- Depends on \`@contractspec/example.crm-pipeline\` events.
|
|
31
31
|
- Tracks export from \`@contractspec/example.learning-journey-crm-onboarding/track\`.
|
|
32
|
-
- Use
|
|
33
|
-
- \`learning.
|
|
34
|
-
- \`learning.
|
|
35
|
-
- \`learning.
|
|
32
|
+
- Use the adaptive journey API:
|
|
33
|
+
- \`learning.journey.listTracks\`
|
|
34
|
+
- \`learning.journey.getProgress\`
|
|
35
|
+
- \`learning.journey.recordEvent\` wired from CRM event bus handlers.
|
|
36
36
|
- Surface in CRM dashboard/pipeline UI to guide new users.`,
|
|
37
37
|
},
|
|
38
38
|
];
|
package/src/operations/index.ts
CHANGED
|
@@ -1,57 +1,17 @@
|
|
|
1
1
|
import { defineCommand, defineQuery } from '@contractspec/lib.contracts-spec';
|
|
2
2
|
import { defineSchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
|
|
3
|
+
import { JourneyTrackModel } from '@contractspec/module.learning-journey/contracts/journey';
|
|
3
4
|
|
|
4
5
|
import { crmFirstWinTrack } from '../track';
|
|
5
6
|
|
|
6
7
|
const OWNERS = ['examples.learning-journey.crm-onboarding'] as const;
|
|
7
|
-
|
|
8
|
-
const StepModel = defineSchemaModel({
|
|
9
|
-
name: 'CrmOnboardingStep',
|
|
10
|
-
description: 'Step metadata for CRM first win journey',
|
|
11
|
-
fields: {
|
|
12
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
13
|
-
title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
14
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
15
|
-
completionEvent: {
|
|
16
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
17
|
-
isOptional: false,
|
|
18
|
-
},
|
|
19
|
-
sourceModule: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
20
|
-
xpReward: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
21
|
-
order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
export const CrmOnboardingTrackModel = defineSchemaModel({
|
|
26
|
-
name: 'CrmOnboardingTrack',
|
|
27
|
-
description: 'CRM onboarding track definition',
|
|
28
|
-
fields: {
|
|
29
|
-
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
30
|
-
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
31
|
-
description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
32
|
-
totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
33
|
-
completionXpBonus: {
|
|
34
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
35
|
-
isOptional: true,
|
|
36
|
-
},
|
|
37
|
-
completionBadgeKey: {
|
|
38
|
-
type: ScalarTypeEnum.String_unsecure(),
|
|
39
|
-
isOptional: true,
|
|
40
|
-
},
|
|
41
|
-
streakHoursWindow: {
|
|
42
|
-
type: ScalarTypeEnum.Int_unsecure(),
|
|
43
|
-
isOptional: true,
|
|
44
|
-
},
|
|
45
|
-
streakBonusXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
|
|
46
|
-
steps: { type: StepModel, isArray: true, isOptional: false },
|
|
47
|
-
},
|
|
48
|
-
});
|
|
8
|
+
export const CrmJourneyTrackModel = JourneyTrackModel;
|
|
49
9
|
|
|
50
10
|
const TrackResponseModel = defineSchemaModel({
|
|
51
11
|
name: 'CrmOnboardingTrackResponse',
|
|
52
12
|
description: 'Response wrapper for CRM onboarding track',
|
|
53
13
|
fields: {
|
|
54
|
-
track: { type:
|
|
14
|
+
track: { type: CrmJourneyTrackModel, isOptional: false },
|
|
55
15
|
},
|
|
56
16
|
});
|
|
57
17
|
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
type PresentationSpecMeta,
|
|
4
4
|
StabilityEnum,
|
|
5
5
|
} from '@contractspec/lib.contracts-spec';
|
|
6
|
-
import {
|
|
6
|
+
import { CrmJourneyTrackModel } from '../operations';
|
|
7
7
|
|
|
8
8
|
const baseMeta: Pick<
|
|
9
9
|
PresentationSpecMeta,
|
|
@@ -29,7 +29,7 @@ export const CrmOnboardingTrackPresentation = definePresentation({
|
|
|
29
29
|
type: 'component',
|
|
30
30
|
framework: 'react',
|
|
31
31
|
componentKey: 'LearningTrackDetail',
|
|
32
|
-
props:
|
|
32
|
+
props: CrmJourneyTrackModel,
|
|
33
33
|
},
|
|
34
34
|
targets: ['react', 'markdown', 'application/json'],
|
|
35
35
|
});
|
package/src/track.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { JourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
|
|
2
2
|
|
|
3
|
-
export const crmFirstWinTrack:
|
|
3
|
+
export const crmFirstWinTrack: JourneyTrackSpec = {
|
|
4
4
|
id: 'crm_first_win',
|
|
5
5
|
productId: 'crm-pipeline',
|
|
6
6
|
name: 'CRM First Win',
|
|
@@ -10,7 +10,7 @@ export const crmFirstWinTrack: LearningJourneyTrackSpec = {
|
|
|
10
10
|
targetRole: 'sales',
|
|
11
11
|
totalXp: 135,
|
|
12
12
|
streakRule: { hoursWindow: 72, bonusXp: 25 },
|
|
13
|
-
completionRewards: {
|
|
13
|
+
completionRewards: { xp: 25, badgeKey: 'crm_first_win' },
|
|
14
14
|
steps: [
|
|
15
15
|
{
|
|
16
16
|
id: 'create_pipeline',
|
|
@@ -29,6 +29,7 @@ export const crmFirstWinTrack: LearningJourneyTrackSpec = {
|
|
|
29
29
|
title: 'Create contact and company',
|
|
30
30
|
description: 'Add your first contact and associated company.',
|
|
31
31
|
order: 2,
|
|
32
|
+
prerequisites: [{ kind: 'step_completed', stepId: 'create_pipeline' }],
|
|
32
33
|
completion: {
|
|
33
34
|
eventName: 'contact.created',
|
|
34
35
|
sourceModule: '@contractspec/example.crm-pipeline',
|
|
@@ -41,6 +42,9 @@ export const crmFirstWinTrack: LearningJourneyTrackSpec = {
|
|
|
41
42
|
title: 'Log first deal',
|
|
42
43
|
description: 'Create your first deal in the pipeline.',
|
|
43
44
|
order: 3,
|
|
45
|
+
prerequisites: [
|
|
46
|
+
{ kind: 'step_completed', stepId: 'create_contact_and_company' },
|
|
47
|
+
],
|
|
44
48
|
completion: {
|
|
45
49
|
eventName: 'deal.created',
|
|
46
50
|
sourceModule: '@contractspec/example.crm-pipeline',
|
|
@@ -53,6 +57,7 @@ export const crmFirstWinTrack: LearningJourneyTrackSpec = {
|
|
|
53
57
|
title: 'Move a deal across stages',
|
|
54
58
|
description: 'Move a deal across at least three stages.',
|
|
55
59
|
order: 4,
|
|
60
|
+
prerequisites: [{ kind: 'step_completed', stepId: 'create_first_deal' }],
|
|
56
61
|
completion: {
|
|
57
62
|
eventName: 'deal.moved',
|
|
58
63
|
sourceModule: '@contractspec/example.crm-pipeline',
|
|
@@ -65,6 +70,9 @@ export const crmFirstWinTrack: LearningJourneyTrackSpec = {
|
|
|
65
70
|
title: 'Close a deal as won',
|
|
66
71
|
description: 'Close a deal as won to hit first revenue.',
|
|
67
72
|
order: 5,
|
|
73
|
+
prerequisites: [
|
|
74
|
+
{ kind: 'step_completed', stepId: 'move_deal_in_pipeline' },
|
|
75
|
+
],
|
|
68
76
|
completion: {
|
|
69
77
|
eventName: 'deal.won',
|
|
70
78
|
sourceModule: '@contractspec/example.crm-pipeline',
|
|
@@ -78,6 +86,7 @@ export const crmFirstWinTrack: LearningJourneyTrackSpec = {
|
|
|
78
86
|
description:
|
|
79
87
|
'Create a follow-up task and notification for a contact or deal.',
|
|
80
88
|
order: 6,
|
|
89
|
+
prerequisites: [{ kind: 'step_completed', stepId: 'close_deal_won' }],
|
|
81
90
|
completion: {
|
|
82
91
|
eventName: 'task.completed',
|
|
83
92
|
sourceModule: '@contractspec/example.crm-pipeline',
|
|
@@ -92,4 +101,4 @@ export const crmFirstWinTrack: LearningJourneyTrackSpec = {
|
|
|
92
101
|
},
|
|
93
102
|
};
|
|
94
103
|
|
|
95
|
-
export const crmLearningTracks:
|
|
104
|
+
export const crmLearningTracks: JourneyTrackSpec[] = [crmFirstWinTrack];
|