@contractspec/example.learning-journey-platform-tour 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 +24 -24
- package/CHANGELOG.md +26 -0
- package/dist/browser/docs/index.js +1 -1
- package/dist/browser/docs/platform-tour.docblock.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/index.js +1 -1
- package/dist/docs/platform-tour.docblock.js +1 -1
- package/dist/handlers/demo.handlers.js +1 -1
- package/dist/index.js +1 -1
- package/dist/node/docs/index.js +1 -1
- package/dist/node/docs/platform-tour.docblock.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 +3 -3
- package/src/docs/platform-tour.docblock.ts +4 -4
- package/src/operations/index.ts +3 -43
- package/src/presentations/index.ts +2 -2
- package/src/track.ts +10 -4
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
2
|
+
var a={id:"platform_primitives_tour",productId:"contractspec-platform",name:"Platform Primitives Tour",description:"Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.",targetUserSegment:"platform_developer",targetRole:"developer",totalXp:140,completionRewards:{xp:20,badgeKey:"platform_primitives"},steps:[{id:"identity_rbac",title:"Create org and member",description:"Create an org and add at least one member.",order:1,completion:{eventName:"org.member.added",sourceModule:"@contractspec/lib.identity-rbac"},xpReward:20,metadata:{surface:"identity"}},{id:"event_bus_audit",title:"Emit an auditable event",description:"Emit an event that lands in the audit log.",order:2,prerequisites:[{kind:"step_completed",stepId:"identity_rbac"}],completion:{eventName:"audit_log.created",sourceModule:"@contractspec/module.audit-trail"},xpReward:20,metadata:{surface:"bus+audit"}},{id:"notifications",title:"Send a notification",description:"Send yourself a notification and verify delivery.",order:3,prerequisites:[{kind:"step_completed",stepId:"event_bus_audit"}],completion:{eventName:"notification.sent",sourceModule:"@contractspec/module.notifications"},xpReward:20,metadata:{surface:"notifications"}},{id:"jobs_scheduler",title:"Schedule and run a job",description:"Schedule a background job and let it run once.",order:4,prerequisites:[{kind:"step_completed",stepId:"notifications"}],completion:{eventName:"job.completed",sourceModule:"@contractspec/lib.jobs"},xpReward:20,metadata:{surface:"jobs"}},{id:"feature_flags",title:"Create and toggle a feature flag",description:"Create a feature flag and toggle it at least once.",order:5,prerequisites:[{kind:"step_completed",stepId:"jobs_scheduler"}],completion:{eventName:"flag.toggled",sourceModule:"@contractspec/lib.feature-flags"},xpReward:20,metadata:{surface:"feature-flags"}},{id:"files_attachments",title:"Attach a file",description:"Upload and attach a file to any entity.",order:6,prerequisites:[{kind:"step_completed",stepId:"feature_flags"}],completion:{eventName:"attachment.attached",sourceModule:"@contractspec/lib.files"},xpReward:20,metadata:{surface:"files"}},{id:"usage_metering",title:"Record usage",description:"Emit a usage metric (regeneration, agent run, or similar).",order:7,prerequisites:[{kind:"step_completed",stepId:"files_attachments"}],completion:{eventName:"usage.recorded",sourceModule:"@contractspec/lib.metering"},xpReward:20,metadata:{surface:"metering"}}],metadata:{surfacedIn:["studio/learning","platform/dev-center"]}},v=[a];import{defineCommand as s,defineQuery as n}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as t,ScalarTypeEnum as e}from"@contractspec/lib.schema";import{JourneyTrackModel as c}from"@contractspec/module.learning-journey/contracts/journey";var r=["examples.learning-journey.platform-tour"],i=c,p=t({name:"PlatformTourTrackResponse",description:"Response wrapper for platform tour track",fields:{track:{type:i,isOptional:!1}}}),l=t({name:"PlatformTourRecordEventInput",description:"Emit a demo event to advance platform tour 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}}}),u=t({name:"PlatformTourSuccess",description:"Generic success response",fields:{success:{type:e.Boolean(),isOptional:!1}}}),m=n({meta:{key:"learningJourney.platformTour.getTrack",version:"1.0.0",stability:"experimental",owners:[...r],tags:["learning","platform","tour"],description:"Fetch platform primitives tour track definition.",goal:"Expose track metadata to UIs and templates.",context:"Called by Studio/Playground to render journey steps."},io:{input:t({name:"PlatformTourTrackInput",description:"Track input",fields:{}}),output:p},policy:{auth:"user"}}),g=s({meta:{key:"learningJourney.platformTour.recordEvent",version:"1.0.0",stability:"experimental",owners:[...r],tags:["learning","platform","tour"],description:"Record an event to advance platform tour 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:l,output:u},policy:{auth:"user"}}),q={GetPlatformTourTrack:m,RecordPlatformTourEvent:g,track:a};import{definePresentation as d,StabilityEnum as f}from"@contractspec/lib.contracts-spec";var o={domain:"learning-journey",title:"Platform Tour",owners:["@examples.learning-journey.platform-tour"],tags:["learning","platform","tour"],stability:f.Experimental,goal:"Visualize platform tour progress",context:"Used in platform tour dashboard and widgets"},_=d({meta:{key:"learning.journey.platform.track",version:"1.0.0",description:"Platform primitives tour track detail",...o},source:{type:"component",framework:"react",componentKey:"LearningTrackDetail",props:i},targets:["react","markdown","application/json"]}),b=d({meta:{key:"learning.journey.platform.widget",version:"1.0.0",description:"Compact widget for platform tour progress",...o},source:{type:"component",framework:"react",componentKey:"LearningTrackProgressWidget"},targets:["react"]}),y=[_,b];export{y as platformTourPresentations,b as PlatformTourWidgetPresentation,_ as PlatformTourTrackPresentation};
|
package/dist/track.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const platformPrimitivesTourTrack:
|
|
3
|
-
export declare const platformLearningTracks:
|
|
1
|
+
import type { JourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
|
|
2
|
+
export declare const platformPrimitivesTourTrack: JourneyTrackSpec;
|
|
3
|
+
export declare const platformLearningTracks: JourneyTrackSpec[];
|
package/dist/track.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var e={id:"platform_primitives_tour",productId:"contractspec-platform",name:"Platform Primitives Tour",description:"Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.",targetUserSegment:"platform_developer",targetRole:"developer",totalXp:140,completionRewards:{
|
|
2
|
+
var e={id:"platform_primitives_tour",productId:"contractspec-platform",name:"Platform Primitives Tour",description:"Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.",targetUserSegment:"platform_developer",targetRole:"developer",totalXp:140,completionRewards:{xp:20,badgeKey:"platform_primitives"},steps:[{id:"identity_rbac",title:"Create org and member",description:"Create an org and add at least one member.",order:1,completion:{eventName:"org.member.added",sourceModule:"@contractspec/lib.identity-rbac"},xpReward:20,metadata:{surface:"identity"}},{id:"event_bus_audit",title:"Emit an auditable event",description:"Emit an event that lands in the audit log.",order:2,prerequisites:[{kind:"step_completed",stepId:"identity_rbac"}],completion:{eventName:"audit_log.created",sourceModule:"@contractspec/module.audit-trail"},xpReward:20,metadata:{surface:"bus+audit"}},{id:"notifications",title:"Send a notification",description:"Send yourself a notification and verify delivery.",order:3,prerequisites:[{kind:"step_completed",stepId:"event_bus_audit"}],completion:{eventName:"notification.sent",sourceModule:"@contractspec/module.notifications"},xpReward:20,metadata:{surface:"notifications"}},{id:"jobs_scheduler",title:"Schedule and run a job",description:"Schedule a background job and let it run once.",order:4,prerequisites:[{kind:"step_completed",stepId:"notifications"}],completion:{eventName:"job.completed",sourceModule:"@contractspec/lib.jobs"},xpReward:20,metadata:{surface:"jobs"}},{id:"feature_flags",title:"Create and toggle a feature flag",description:"Create a feature flag and toggle it at least once.",order:5,prerequisites:[{kind:"step_completed",stepId:"jobs_scheduler"}],completion:{eventName:"flag.toggled",sourceModule:"@contractspec/lib.feature-flags"},xpReward:20,metadata:{surface:"feature-flags"}},{id:"files_attachments",title:"Attach a file",description:"Upload and attach a file to any entity.",order:6,prerequisites:[{kind:"step_completed",stepId:"feature_flags"}],completion:{eventName:"attachment.attached",sourceModule:"@contractspec/lib.files"},xpReward:20,metadata:{surface:"files"}},{id:"usage_metering",title:"Record usage",description:"Emit a usage metric (regeneration, agent run, or similar).",order:7,prerequisites:[{kind:"step_completed",stepId:"files_attachments"}],completion:{eventName:"usage.recorded",sourceModule:"@contractspec/lib.metering"},xpReward:20,metadata:{surface:"metering"}}],metadata:{surfacedIn:["studio/learning","platform/dev-center"]}},t=[e];export{e as platformPrimitivesTourTrack,t as platformLearningTracks};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.learning-journey-platform-tour",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Learning journey track covering ContractSpec platform primitives.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -91,9 +91,9 @@
|
|
|
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": "
|
|
96
|
+
"@contractspec/module.learning-journey": "4.0.0"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@contractspec/tool.typescript": "3.7.13",
|
|
@@ -29,10 +29,10 @@ XP: 20 per step, 20 bonus XP upon completion.
|
|
|
29
29
|
|
|
30
30
|
## Wiring
|
|
31
31
|
- Tracks export from \`@contractspec/example.learning-journey-platform-tour/track\`.
|
|
32
|
-
- Use
|
|
33
|
-
- \`learning.
|
|
34
|
-
- \`learning.
|
|
35
|
-
- \`learning.
|
|
32
|
+
- Use adaptive journey API to surface progress:
|
|
33
|
+
- \`learning.journey.listTracks\`
|
|
34
|
+
- \`learning.journey.getProgress\`
|
|
35
|
+
- \`learning.journey.recordEvent\` wired from each module's event bus handlers.
|
|
36
36
|
- Align event payloads with modules: identity-rbac, audit-trail, notifications, jobs, feature-flags, files, metering.`,
|
|
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 { platformPrimitivesTourTrack } from '../track';
|
|
5
6
|
|
|
6
7
|
const OWNERS = ['examples.learning-journey.platform-tour'] as const;
|
|
7
|
-
|
|
8
|
-
const StepModel = defineSchemaModel({
|
|
9
|
-
name: 'PlatformTourStep',
|
|
10
|
-
description: 'Step metadata for platform primitives tour',
|
|
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 PlatformTourTrackModel = defineSchemaModel({
|
|
26
|
-
name: 'PlatformTourTrack',
|
|
27
|
-
description: 'Platform primitives tour 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 PlatformJourneyTrackModel = JourneyTrackModel;
|
|
49
9
|
|
|
50
10
|
const TrackResponseModel = defineSchemaModel({
|
|
51
11
|
name: 'PlatformTourTrackResponse',
|
|
52
12
|
description: 'Response wrapper for platform tour track',
|
|
53
13
|
fields: {
|
|
54
|
-
track: { type:
|
|
14
|
+
track: { type: PlatformJourneyTrackModel, 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 { PlatformJourneyTrackModel } from '../operations';
|
|
7
7
|
|
|
8
8
|
const baseMeta: Pick<
|
|
9
9
|
PresentationSpecMeta,
|
|
@@ -29,7 +29,7 @@ export const PlatformTourTrackPresentation = definePresentation({
|
|
|
29
29
|
type: 'component',
|
|
30
30
|
framework: 'react',
|
|
31
31
|
componentKey: 'LearningTrackDetail',
|
|
32
|
-
props:
|
|
32
|
+
props: PlatformJourneyTrackModel,
|
|
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 platformPrimitivesTourTrack:
|
|
3
|
+
export const platformPrimitivesTourTrack: JourneyTrackSpec = {
|
|
4
4
|
id: 'platform_primitives_tour',
|
|
5
5
|
productId: 'contractspec-platform',
|
|
6
6
|
name: 'Platform Primitives Tour',
|
|
@@ -9,7 +9,7 @@ export const platformPrimitivesTourTrack: LearningJourneyTrackSpec = {
|
|
|
9
9
|
targetUserSegment: 'platform_developer',
|
|
10
10
|
targetRole: 'developer',
|
|
11
11
|
totalXp: 140,
|
|
12
|
-
completionRewards: {
|
|
12
|
+
completionRewards: { xp: 20, badgeKey: 'platform_primitives' },
|
|
13
13
|
steps: [
|
|
14
14
|
{
|
|
15
15
|
id: 'identity_rbac',
|
|
@@ -28,6 +28,7 @@ export const platformPrimitivesTourTrack: LearningJourneyTrackSpec = {
|
|
|
28
28
|
title: 'Emit an auditable event',
|
|
29
29
|
description: 'Emit an event that lands in the audit log.',
|
|
30
30
|
order: 2,
|
|
31
|
+
prerequisites: [{ kind: 'step_completed', stepId: 'identity_rbac' }],
|
|
31
32
|
completion: {
|
|
32
33
|
eventName: 'audit_log.created',
|
|
33
34
|
sourceModule: '@contractspec/module.audit-trail',
|
|
@@ -40,6 +41,7 @@ export const platformPrimitivesTourTrack: LearningJourneyTrackSpec = {
|
|
|
40
41
|
title: 'Send a notification',
|
|
41
42
|
description: 'Send yourself a notification and verify delivery.',
|
|
42
43
|
order: 3,
|
|
44
|
+
prerequisites: [{ kind: 'step_completed', stepId: 'event_bus_audit' }],
|
|
43
45
|
completion: {
|
|
44
46
|
eventName: 'notification.sent',
|
|
45
47
|
sourceModule: '@contractspec/module.notifications',
|
|
@@ -52,6 +54,7 @@ export const platformPrimitivesTourTrack: LearningJourneyTrackSpec = {
|
|
|
52
54
|
title: 'Schedule and run a job',
|
|
53
55
|
description: 'Schedule a background job and let it run once.',
|
|
54
56
|
order: 4,
|
|
57
|
+
prerequisites: [{ kind: 'step_completed', stepId: 'notifications' }],
|
|
55
58
|
completion: {
|
|
56
59
|
eventName: 'job.completed',
|
|
57
60
|
sourceModule: '@contractspec/lib.jobs',
|
|
@@ -64,6 +67,7 @@ export const platformPrimitivesTourTrack: LearningJourneyTrackSpec = {
|
|
|
64
67
|
title: 'Create and toggle a feature flag',
|
|
65
68
|
description: 'Create a feature flag and toggle it at least once.',
|
|
66
69
|
order: 5,
|
|
70
|
+
prerequisites: [{ kind: 'step_completed', stepId: 'jobs_scheduler' }],
|
|
67
71
|
completion: {
|
|
68
72
|
eventName: 'flag.toggled',
|
|
69
73
|
sourceModule: '@contractspec/lib.feature-flags',
|
|
@@ -76,6 +80,7 @@ export const platformPrimitivesTourTrack: LearningJourneyTrackSpec = {
|
|
|
76
80
|
title: 'Attach a file',
|
|
77
81
|
description: 'Upload and attach a file to any entity.',
|
|
78
82
|
order: 6,
|
|
83
|
+
prerequisites: [{ kind: 'step_completed', stepId: 'feature_flags' }],
|
|
79
84
|
completion: {
|
|
80
85
|
eventName: 'attachment.attached',
|
|
81
86
|
sourceModule: '@contractspec/lib.files',
|
|
@@ -88,6 +93,7 @@ export const platformPrimitivesTourTrack: LearningJourneyTrackSpec = {
|
|
|
88
93
|
title: 'Record usage',
|
|
89
94
|
description: 'Emit a usage metric (regeneration, agent run, or similar).',
|
|
90
95
|
order: 7,
|
|
96
|
+
prerequisites: [{ kind: 'step_completed', stepId: 'files_attachments' }],
|
|
91
97
|
completion: {
|
|
92
98
|
eventName: 'usage.recorded',
|
|
93
99
|
sourceModule: '@contractspec/lib.metering',
|
|
@@ -101,6 +107,6 @@ export const platformPrimitivesTourTrack: LearningJourneyTrackSpec = {
|
|
|
101
107
|
},
|
|
102
108
|
};
|
|
103
109
|
|
|
104
|
-
export const platformLearningTracks:
|
|
110
|
+
export const platformLearningTracks: JourneyTrackSpec[] = [
|
|
105
111
|
platformPrimitivesTourTrack,
|
|
106
112
|
];
|