@contractspec/example.learning-journey-platform-tour 3.7.17 → 3.7.19

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.
Files changed (33) hide show
  1. package/.turbo/turbo-build.log +33 -33
  2. package/CHANGELOG.md +20 -0
  3. package/dist/browser/docs/index.js +1 -37
  4. package/dist/browser/docs/platform-tour.docblock.js +1 -37
  5. package/dist/browser/example.js +1 -34
  6. package/dist/browser/handlers/demo.handlers.js +1 -130
  7. package/dist/browser/index.js +1 -416
  8. package/dist/browser/learning-journey-platform-tour.feature.js +1 -48
  9. package/dist/browser/operations/index.js +1 -221
  10. package/dist/browser/presentations/index.js +1 -268
  11. package/dist/browser/tests/operations.test-spec.js +1 -34
  12. package/dist/browser/track.js +1 -107
  13. package/dist/docs/index.js +1 -37
  14. package/dist/docs/platform-tour.docblock.js +1 -37
  15. package/dist/example.js +1 -34
  16. package/dist/handlers/demo.handlers.js +1 -130
  17. package/dist/index.js +1 -416
  18. package/dist/learning-journey-platform-tour.feature.js +1 -48
  19. package/dist/node/docs/index.js +1 -37
  20. package/dist/node/docs/platform-tour.docblock.js +1 -37
  21. package/dist/node/example.js +1 -34
  22. package/dist/node/handlers/demo.handlers.js +1 -130
  23. package/dist/node/index.js +1 -416
  24. package/dist/node/learning-journey-platform-tour.feature.js +1 -48
  25. package/dist/node/operations/index.js +1 -221
  26. package/dist/node/presentations/index.js +1 -268
  27. package/dist/node/tests/operations.test-spec.js +1 -34
  28. package/dist/node/track.js +1 -107
  29. package/dist/operations/index.js +1 -221
  30. package/dist/presentations/index.js +1 -268
  31. package/dist/tests/operations.test-spec.js +1 -34
  32. package/dist/track.js +1 -107
  33. package/package.json +6 -6
@@ -1,222 +1,2 @@
1
1
  // @bun
2
- // src/track.ts
3
- var platformPrimitivesTourTrack = {
4
- id: "platform_primitives_tour",
5
- productId: "contractspec-platform",
6
- name: "Platform Primitives Tour",
7
- description: "Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.",
8
- targetUserSegment: "platform_developer",
9
- targetRole: "developer",
10
- totalXp: 140,
11
- completionRewards: { xpBonus: 20, badgeKey: "platform_primitives" },
12
- steps: [
13
- {
14
- id: "identity_rbac",
15
- title: "Create org and member",
16
- description: "Create an org and add at least one member.",
17
- order: 1,
18
- completion: {
19
- eventName: "org.member.added",
20
- sourceModule: "@contractspec/lib.identity-rbac"
21
- },
22
- xpReward: 20,
23
- metadata: { surface: "identity" }
24
- },
25
- {
26
- id: "event_bus_audit",
27
- title: "Emit an auditable event",
28
- description: "Emit an event that lands in the audit log.",
29
- order: 2,
30
- completion: {
31
- eventName: "audit_log.created",
32
- sourceModule: "@contractspec/module.audit-trail"
33
- },
34
- xpReward: 20,
35
- metadata: { surface: "bus+audit" }
36
- },
37
- {
38
- id: "notifications",
39
- title: "Send a notification",
40
- description: "Send yourself a notification and verify delivery.",
41
- order: 3,
42
- completion: {
43
- eventName: "notification.sent",
44
- sourceModule: "@contractspec/module.notifications"
45
- },
46
- xpReward: 20,
47
- metadata: { surface: "notifications" }
48
- },
49
- {
50
- id: "jobs_scheduler",
51
- title: "Schedule and run a job",
52
- description: "Schedule a background job and let it run once.",
53
- order: 4,
54
- completion: {
55
- eventName: "job.completed",
56
- sourceModule: "@contractspec/lib.jobs"
57
- },
58
- xpReward: 20,
59
- metadata: { surface: "jobs" }
60
- },
61
- {
62
- id: "feature_flags",
63
- title: "Create and toggle a feature flag",
64
- description: "Create a feature flag and toggle it at least once.",
65
- order: 5,
66
- completion: {
67
- eventName: "flag.toggled",
68
- sourceModule: "@contractspec/lib.feature-flags"
69
- },
70
- xpReward: 20,
71
- metadata: { surface: "feature-flags" }
72
- },
73
- {
74
- id: "files_attachments",
75
- title: "Attach a file",
76
- description: "Upload and attach a file to any entity.",
77
- order: 6,
78
- completion: {
79
- eventName: "attachment.attached",
80
- sourceModule: "@contractspec/lib.files"
81
- },
82
- xpReward: 20,
83
- metadata: { surface: "files" }
84
- },
85
- {
86
- id: "usage_metering",
87
- title: "Record usage",
88
- description: "Emit a usage metric (regeneration, agent run, or similar).",
89
- order: 7,
90
- completion: {
91
- eventName: "usage.recorded",
92
- sourceModule: "@contractspec/lib.metering"
93
- },
94
- xpReward: 20,
95
- metadata: { surface: "metering" }
96
- }
97
- ],
98
- metadata: {
99
- surfacedIn: ["studio/learning", "platform/dev-center"]
100
- }
101
- };
102
- var platformLearningTracks = [
103
- platformPrimitivesTourTrack
104
- ];
105
-
106
- // src/operations/index.ts
107
- import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
108
- import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
109
- var OWNERS = ["examples.learning-journey.platform-tour"];
110
- var StepModel = defineSchemaModel({
111
- name: "PlatformTourStep",
112
- description: "Step metadata for platform primitives tour",
113
- fields: {
114
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
115
- title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
116
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
117
- completionEvent: {
118
- type: ScalarTypeEnum.String_unsecure(),
119
- isOptional: false
120
- },
121
- sourceModule: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
122
- xpReward: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
123
- order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true }
124
- }
125
- });
126
- var PlatformTourTrackModel = defineSchemaModel({
127
- name: "PlatformTourTrack",
128
- description: "Platform primitives tour track definition",
129
- fields: {
130
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
131
- name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
132
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
133
- totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
134
- completionXpBonus: {
135
- type: ScalarTypeEnum.Int_unsecure(),
136
- isOptional: true
137
- },
138
- completionBadgeKey: {
139
- type: ScalarTypeEnum.String_unsecure(),
140
- isOptional: true
141
- },
142
- streakHoursWindow: {
143
- type: ScalarTypeEnum.Int_unsecure(),
144
- isOptional: true
145
- },
146
- streakBonusXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
147
- steps: { type: StepModel, isArray: true, isOptional: false }
148
- }
149
- });
150
- var TrackResponseModel = defineSchemaModel({
151
- name: "PlatformTourTrackResponse",
152
- description: "Response wrapper for platform tour track",
153
- fields: {
154
- track: { type: PlatformTourTrackModel, isOptional: false }
155
- }
156
- });
157
- var RecordDemoEventInput = defineSchemaModel({
158
- name: "PlatformTourRecordEventInput",
159
- description: "Emit a demo event to advance platform tour steps",
160
- fields: {
161
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
162
- eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
163
- payload: { type: ScalarTypeEnum.JSON(), isOptional: true },
164
- occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
165
- }
166
- });
167
- var SuccessModel = defineSchemaModel({
168
- name: "PlatformTourSuccess",
169
- description: "Generic success response",
170
- fields: {
171
- success: { type: ScalarTypeEnum.Boolean(), isOptional: false }
172
- }
173
- });
174
- var GetPlatformTourTrack = defineQuery({
175
- meta: {
176
- key: "learningJourney.platformTour.getTrack",
177
- version: "1.0.0",
178
- stability: "experimental",
179
- owners: [...OWNERS],
180
- tags: ["learning", "platform", "tour"],
181
- description: "Fetch platform primitives tour track definition.",
182
- goal: "Expose track metadata to UIs and templates.",
183
- context: "Called by Studio/Playground to render journey steps."
184
- },
185
- io: {
186
- input: defineSchemaModel({
187
- name: "PlatformTourTrackInput",
188
- description: "Track input",
189
- fields: {}
190
- }),
191
- output: TrackResponseModel
192
- },
193
- policy: { auth: "user" }
194
- });
195
- var RecordPlatformTourEvent = defineCommand({
196
- meta: {
197
- key: "learningJourney.platformTour.recordEvent",
198
- version: "1.0.0",
199
- stability: "experimental",
200
- owners: [...OWNERS],
201
- tags: ["learning", "platform", "tour"],
202
- description: "Record an event to advance platform tour progress.",
203
- goal: "Advance steps via domain events in demo/sandbox contexts.",
204
- context: "Called by handlers or demo scripts to emit step completion events."
205
- },
206
- io: {
207
- input: RecordDemoEventInput,
208
- output: SuccessModel
209
- },
210
- policy: { auth: "user" }
211
- });
212
- var platformTourContracts = {
213
- GetPlatformTourTrack,
214
- RecordPlatformTourEvent,
215
- track: platformPrimitivesTourTrack
216
- };
217
- export {
218
- platformTourContracts,
219
- RecordPlatformTourEvent,
220
- PlatformTourTrackModel,
221
- GetPlatformTourTrack
222
- };
2
+ var i={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:{xpBonus: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,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,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,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,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,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,completion:{eventName:"usage.recorded",sourceModule:"@contractspec/lib.metering"},xpReward:20,metadata:{surface:"metering"}}],metadata:{surfacedIn:["studio/learning","platform/dev-center"]}},f=[i];import{defineCommand as o,defineQuery as r}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as e,ScalarTypeEnum as t}from"@contractspec/lib.schema";var a=["examples.learning-journey.platform-tour"],d=e({name:"PlatformTourStep",description:"Step metadata for platform primitives tour",fields:{id:{type:t.String_unsecure(),isOptional:!1},title:{type:t.String_unsecure(),isOptional:!1},description:{type:t.String_unsecure(),isOptional:!0},completionEvent:{type:t.String_unsecure(),isOptional:!1},sourceModule:{type:t.String_unsecure(),isOptional:!0},xpReward:{type:t.Int_unsecure(),isOptional:!0},order:{type:t.Int_unsecure(),isOptional:!0}}}),n=e({name:"PlatformTourTrack",description:"Platform primitives tour track definition",fields:{id:{type:t.String_unsecure(),isOptional:!1},name:{type:t.String_unsecure(),isOptional:!1},description:{type:t.String_unsecure(),isOptional:!0},totalXp:{type:t.Int_unsecure(),isOptional:!0},completionXpBonus:{type:t.Int_unsecure(),isOptional:!0},completionBadgeKey:{type:t.String_unsecure(),isOptional:!0},streakHoursWindow:{type:t.Int_unsecure(),isOptional:!0},streakBonusXp:{type:t.Int_unsecure(),isOptional:!0},steps:{type:d,isArray:!0,isOptional:!1}}}),s=e({name:"PlatformTourTrackResponse",description:"Response wrapper for platform tour track",fields:{track:{type:n,isOptional:!1}}}),c=e({name:"PlatformTourRecordEventInput",description:"Emit a demo event to advance platform tour steps",fields:{learnerId:{type:t.String_unsecure(),isOptional:!1},eventName:{type:t.String_unsecure(),isOptional:!1},payload:{type:t.JSON(),isOptional:!0},occurredAt:{type:t.DateTime(),isOptional:!0}}}),l=e({name:"PlatformTourSuccess",description:"Generic success response",fields:{success:{type:t.Boolean(),isOptional:!1}}}),g=r({meta:{key:"learningJourney.platformTour.getTrack",version:"1.0.0",stability:"experimental",owners:[...a],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:e({name:"PlatformTourTrackInput",description:"Track input",fields:{}}),output:s},policy:{auth:"user"}}),u=o({meta:{key:"learningJourney.platformTour.recordEvent",version:"1.0.0",stability:"experimental",owners:[...a],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:c,output:l},policy:{auth:"user"}}),_={GetPlatformTourTrack:g,RecordPlatformTourEvent:u,track:i};export{_ as platformTourContracts,u as RecordPlatformTourEvent,n as PlatformTourTrackModel,g as GetPlatformTourTrack};
@@ -1,269 +1,2 @@
1
1
  // @bun
2
- // src/track.ts
3
- var platformPrimitivesTourTrack = {
4
- id: "platform_primitives_tour",
5
- productId: "contractspec-platform",
6
- name: "Platform Primitives Tour",
7
- description: "Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.",
8
- targetUserSegment: "platform_developer",
9
- targetRole: "developer",
10
- totalXp: 140,
11
- completionRewards: { xpBonus: 20, badgeKey: "platform_primitives" },
12
- steps: [
13
- {
14
- id: "identity_rbac",
15
- title: "Create org and member",
16
- description: "Create an org and add at least one member.",
17
- order: 1,
18
- completion: {
19
- eventName: "org.member.added",
20
- sourceModule: "@contractspec/lib.identity-rbac"
21
- },
22
- xpReward: 20,
23
- metadata: { surface: "identity" }
24
- },
25
- {
26
- id: "event_bus_audit",
27
- title: "Emit an auditable event",
28
- description: "Emit an event that lands in the audit log.",
29
- order: 2,
30
- completion: {
31
- eventName: "audit_log.created",
32
- sourceModule: "@contractspec/module.audit-trail"
33
- },
34
- xpReward: 20,
35
- metadata: { surface: "bus+audit" }
36
- },
37
- {
38
- id: "notifications",
39
- title: "Send a notification",
40
- description: "Send yourself a notification and verify delivery.",
41
- order: 3,
42
- completion: {
43
- eventName: "notification.sent",
44
- sourceModule: "@contractspec/module.notifications"
45
- },
46
- xpReward: 20,
47
- metadata: { surface: "notifications" }
48
- },
49
- {
50
- id: "jobs_scheduler",
51
- title: "Schedule and run a job",
52
- description: "Schedule a background job and let it run once.",
53
- order: 4,
54
- completion: {
55
- eventName: "job.completed",
56
- sourceModule: "@contractspec/lib.jobs"
57
- },
58
- xpReward: 20,
59
- metadata: { surface: "jobs" }
60
- },
61
- {
62
- id: "feature_flags",
63
- title: "Create and toggle a feature flag",
64
- description: "Create a feature flag and toggle it at least once.",
65
- order: 5,
66
- completion: {
67
- eventName: "flag.toggled",
68
- sourceModule: "@contractspec/lib.feature-flags"
69
- },
70
- xpReward: 20,
71
- metadata: { surface: "feature-flags" }
72
- },
73
- {
74
- id: "files_attachments",
75
- title: "Attach a file",
76
- description: "Upload and attach a file to any entity.",
77
- order: 6,
78
- completion: {
79
- eventName: "attachment.attached",
80
- sourceModule: "@contractspec/lib.files"
81
- },
82
- xpReward: 20,
83
- metadata: { surface: "files" }
84
- },
85
- {
86
- id: "usage_metering",
87
- title: "Record usage",
88
- description: "Emit a usage metric (regeneration, agent run, or similar).",
89
- order: 7,
90
- completion: {
91
- eventName: "usage.recorded",
92
- sourceModule: "@contractspec/lib.metering"
93
- },
94
- xpReward: 20,
95
- metadata: { surface: "metering" }
96
- }
97
- ],
98
- metadata: {
99
- surfacedIn: ["studio/learning", "platform/dev-center"]
100
- }
101
- };
102
- var platformLearningTracks = [
103
- platformPrimitivesTourTrack
104
- ];
105
-
106
- // src/operations/index.ts
107
- import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
108
- import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
109
- var OWNERS = ["examples.learning-journey.platform-tour"];
110
- var StepModel = defineSchemaModel({
111
- name: "PlatformTourStep",
112
- description: "Step metadata for platform primitives tour",
113
- fields: {
114
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
115
- title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
116
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
117
- completionEvent: {
118
- type: ScalarTypeEnum.String_unsecure(),
119
- isOptional: false
120
- },
121
- sourceModule: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
122
- xpReward: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
123
- order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true }
124
- }
125
- });
126
- var PlatformTourTrackModel = defineSchemaModel({
127
- name: "PlatformTourTrack",
128
- description: "Platform primitives tour track definition",
129
- fields: {
130
- id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
131
- name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
132
- description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
133
- totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
134
- completionXpBonus: {
135
- type: ScalarTypeEnum.Int_unsecure(),
136
- isOptional: true
137
- },
138
- completionBadgeKey: {
139
- type: ScalarTypeEnum.String_unsecure(),
140
- isOptional: true
141
- },
142
- streakHoursWindow: {
143
- type: ScalarTypeEnum.Int_unsecure(),
144
- isOptional: true
145
- },
146
- streakBonusXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },
147
- steps: { type: StepModel, isArray: true, isOptional: false }
148
- }
149
- });
150
- var TrackResponseModel = defineSchemaModel({
151
- name: "PlatformTourTrackResponse",
152
- description: "Response wrapper for platform tour track",
153
- fields: {
154
- track: { type: PlatformTourTrackModel, isOptional: false }
155
- }
156
- });
157
- var RecordDemoEventInput = defineSchemaModel({
158
- name: "PlatformTourRecordEventInput",
159
- description: "Emit a demo event to advance platform tour steps",
160
- fields: {
161
- learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
162
- eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
163
- payload: { type: ScalarTypeEnum.JSON(), isOptional: true },
164
- occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: true }
165
- }
166
- });
167
- var SuccessModel = defineSchemaModel({
168
- name: "PlatformTourSuccess",
169
- description: "Generic success response",
170
- fields: {
171
- success: { type: ScalarTypeEnum.Boolean(), isOptional: false }
172
- }
173
- });
174
- var GetPlatformTourTrack = defineQuery({
175
- meta: {
176
- key: "learningJourney.platformTour.getTrack",
177
- version: "1.0.0",
178
- stability: "experimental",
179
- owners: [...OWNERS],
180
- tags: ["learning", "platform", "tour"],
181
- description: "Fetch platform primitives tour track definition.",
182
- goal: "Expose track metadata to UIs and templates.",
183
- context: "Called by Studio/Playground to render journey steps."
184
- },
185
- io: {
186
- input: defineSchemaModel({
187
- name: "PlatformTourTrackInput",
188
- description: "Track input",
189
- fields: {}
190
- }),
191
- output: TrackResponseModel
192
- },
193
- policy: { auth: "user" }
194
- });
195
- var RecordPlatformTourEvent = defineCommand({
196
- meta: {
197
- key: "learningJourney.platformTour.recordEvent",
198
- version: "1.0.0",
199
- stability: "experimental",
200
- owners: [...OWNERS],
201
- tags: ["learning", "platform", "tour"],
202
- description: "Record an event to advance platform tour progress.",
203
- goal: "Advance steps via domain events in demo/sandbox contexts.",
204
- context: "Called by handlers or demo scripts to emit step completion events."
205
- },
206
- io: {
207
- input: RecordDemoEventInput,
208
- output: SuccessModel
209
- },
210
- policy: { auth: "user" }
211
- });
212
- var platformTourContracts = {
213
- GetPlatformTourTrack,
214
- RecordPlatformTourEvent,
215
- track: platformPrimitivesTourTrack
216
- };
217
-
218
- // src/presentations/index.ts
219
- import {
220
- definePresentation,
221
- StabilityEnum
222
- } from "@contractspec/lib.contracts-spec";
223
- var baseMeta = {
224
- domain: "learning-journey",
225
- title: "Platform Tour",
226
- owners: ["@examples.learning-journey.platform-tour"],
227
- tags: ["learning", "platform", "tour"],
228
- stability: StabilityEnum.Experimental,
229
- goal: "Visualize platform tour progress",
230
- context: "Used in platform tour dashboard and widgets"
231
- };
232
- var PlatformTourTrackPresentation = definePresentation({
233
- meta: {
234
- key: "learning.journey.platform.track",
235
- version: "1.0.0",
236
- description: "Platform primitives tour track detail",
237
- ...baseMeta
238
- },
239
- source: {
240
- type: "component",
241
- framework: "react",
242
- componentKey: "LearningTrackDetail",
243
- props: PlatformTourTrackModel
244
- },
245
- targets: ["react", "markdown", "application/json"]
246
- });
247
- var PlatformTourWidgetPresentation = definePresentation({
248
- meta: {
249
- key: "learning.journey.platform.widget",
250
- version: "1.0.0",
251
- description: "Compact widget for platform tour progress",
252
- ...baseMeta
253
- },
254
- source: {
255
- type: "component",
256
- framework: "react",
257
- componentKey: "LearningTrackProgressWidget"
258
- },
259
- targets: ["react"]
260
- });
261
- var platformTourPresentations = [
262
- PlatformTourTrackPresentation,
263
- PlatformTourWidgetPresentation
264
- ];
265
- export {
266
- platformTourPresentations,
267
- PlatformTourWidgetPresentation,
268
- PlatformTourTrackPresentation
269
- };
2
+ var i={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:{xpBonus: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,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,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,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,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,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,completion:{eventName:"usage.recorded",sourceModule:"@contractspec/lib.metering"},xpReward:20,metadata:{surface:"metering"}}],metadata:{surfacedIn:["studio/learning","platform/dev-center"]}},_=[i];import{defineCommand as n,defineQuery as s}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as e,ScalarTypeEnum as t}from"@contractspec/lib.schema";var o=["examples.learning-journey.platform-tour"],c=e({name:"PlatformTourStep",description:"Step metadata for platform primitives tour",fields:{id:{type:t.String_unsecure(),isOptional:!1},title:{type:t.String_unsecure(),isOptional:!1},description:{type:t.String_unsecure(),isOptional:!0},completionEvent:{type:t.String_unsecure(),isOptional:!1},sourceModule:{type:t.String_unsecure(),isOptional:!0},xpReward:{type:t.Int_unsecure(),isOptional:!0},order:{type:t.Int_unsecure(),isOptional:!0}}}),a=e({name:"PlatformTourTrack",description:"Platform primitives tour track definition",fields:{id:{type:t.String_unsecure(),isOptional:!1},name:{type:t.String_unsecure(),isOptional:!1},description:{type:t.String_unsecure(),isOptional:!0},totalXp:{type:t.Int_unsecure(),isOptional:!0},completionXpBonus:{type:t.Int_unsecure(),isOptional:!0},completionBadgeKey:{type:t.String_unsecure(),isOptional:!0},streakHoursWindow:{type:t.Int_unsecure(),isOptional:!0},streakBonusXp:{type:t.Int_unsecure(),isOptional:!0},steps:{type:c,isArray:!0,isOptional:!1}}}),g=e({name:"PlatformTourTrackResponse",description:"Response wrapper for platform tour track",fields:{track:{type:a,isOptional:!1}}}),l=e({name:"PlatformTourRecordEventInput",description:"Emit a demo event to advance platform tour steps",fields:{learnerId:{type:t.String_unsecure(),isOptional:!1},eventName:{type:t.String_unsecure(),isOptional:!1},payload:{type:t.JSON(),isOptional:!0},occurredAt:{type:t.DateTime(),isOptional:!0}}}),u=e({name:"PlatformTourSuccess",description:"Generic success response",fields:{success:{type:t.Boolean(),isOptional:!1}}}),f=s({meta:{key:"learningJourney.platformTour.getTrack",version:"1.0.0",stability:"experimental",owners:[...o],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:e({name:"PlatformTourTrackInput",description:"Track input",fields:{}}),output:g},policy:{auth:"user"}}),p=n({meta:{key:"learningJourney.platformTour.recordEvent",version:"1.0.0",stability:"experimental",owners:[...o],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"}}),R={GetPlatformTourTrack:f,RecordPlatformTourEvent:p,track:i};import{definePresentation as r,StabilityEnum as m}from"@contractspec/lib.contracts-spec";var d={domain:"learning-journey",title:"Platform Tour",owners:["@examples.learning-journey.platform-tour"],tags:["learning","platform","tour"],stability:m.Experimental,goal:"Visualize platform tour progress",context:"Used in platform tour dashboard and widgets"},b=r({meta:{key:"learning.journey.platform.track",version:"1.0.0",description:"Platform primitives tour track detail",...d},source:{type:"component",framework:"react",componentKey:"LearningTrackDetail",props:a},targets:["react","markdown","application/json"]}),v=r({meta:{key:"learning.journey.platform.widget",version:"1.0.0",description:"Compact widget for platform tour progress",...d},source:{type:"component",framework:"react",componentKey:"LearningTrackProgressWidget"},targets:["react"]}),J=[b,v];export{J as platformTourPresentations,v as PlatformTourWidgetPresentation,b as PlatformTourTrackPresentation};
@@ -1,35 +1,2 @@
1
1
  // @bun
2
- // src/tests/operations.test-spec.ts
3
- import { defineTestSpec } from "@contractspec/lib.contracts-spec/tests";
4
- var GetTrackTest = defineTestSpec({
5
- meta: {
6
- key: "learningJourney.platformTour.getTrack.test",
7
- version: "1.0.0",
8
- stability: "experimental",
9
- owners: ["@example.learning-journey-platform-tour"],
10
- description: "Test for getting platform tour track",
11
- tags: ["test"]
12
- },
13
- target: {
14
- type: "operation",
15
- operation: {
16
- key: "learningJourney.platformTour.getTrack",
17
- version: "1.0.0"
18
- }
19
- },
20
- scenarios: [
21
- {
22
- key: "success",
23
- when: { operation: { key: "learningJourney.platformTour.getTrack" } },
24
- then: [{ type: "expectOutput", match: {} }]
25
- },
26
- {
27
- key: "error",
28
- when: { operation: { key: "learningJourney.platformTour.getTrack" } },
29
- then: [{ type: "expectError" }]
30
- }
31
- ]
32
- });
33
- export {
34
- GetTrackTest
35
- };
2
+ import{defineTestSpec as g}from"@contractspec/lib.contracts-spec/tests";var j=g({meta:{key:"learningJourney.platformTour.getTrack.test",version:"1.0.0",stability:"experimental",owners:["@example.learning-journey-platform-tour"],description:"Test for getting platform tour track",tags:["test"]},target:{type:"operation",operation:{key:"learningJourney.platformTour.getTrack",version:"1.0.0"}},scenarios:[{key:"success",when:{operation:{key:"learningJourney.platformTour.getTrack"}},then:[{type:"expectOutput",match:{}}]},{key:"error",when:{operation:{key:"learningJourney.platformTour.getTrack"}},then:[{type:"expectError"}]}]});export{j as GetTrackTest};
package/dist/track.js CHANGED
@@ -1,108 +1,2 @@
1
1
  // @bun
2
- // src/track.ts
3
- var platformPrimitivesTourTrack = {
4
- id: "platform_primitives_tour",
5
- productId: "contractspec-platform",
6
- name: "Platform Primitives Tour",
7
- description: "Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.",
8
- targetUserSegment: "platform_developer",
9
- targetRole: "developer",
10
- totalXp: 140,
11
- completionRewards: { xpBonus: 20, badgeKey: "platform_primitives" },
12
- steps: [
13
- {
14
- id: "identity_rbac",
15
- title: "Create org and member",
16
- description: "Create an org and add at least one member.",
17
- order: 1,
18
- completion: {
19
- eventName: "org.member.added",
20
- sourceModule: "@contractspec/lib.identity-rbac"
21
- },
22
- xpReward: 20,
23
- metadata: { surface: "identity" }
24
- },
25
- {
26
- id: "event_bus_audit",
27
- title: "Emit an auditable event",
28
- description: "Emit an event that lands in the audit log.",
29
- order: 2,
30
- completion: {
31
- eventName: "audit_log.created",
32
- sourceModule: "@contractspec/module.audit-trail"
33
- },
34
- xpReward: 20,
35
- metadata: { surface: "bus+audit" }
36
- },
37
- {
38
- id: "notifications",
39
- title: "Send a notification",
40
- description: "Send yourself a notification and verify delivery.",
41
- order: 3,
42
- completion: {
43
- eventName: "notification.sent",
44
- sourceModule: "@contractspec/module.notifications"
45
- },
46
- xpReward: 20,
47
- metadata: { surface: "notifications" }
48
- },
49
- {
50
- id: "jobs_scheduler",
51
- title: "Schedule and run a job",
52
- description: "Schedule a background job and let it run once.",
53
- order: 4,
54
- completion: {
55
- eventName: "job.completed",
56
- sourceModule: "@contractspec/lib.jobs"
57
- },
58
- xpReward: 20,
59
- metadata: { surface: "jobs" }
60
- },
61
- {
62
- id: "feature_flags",
63
- title: "Create and toggle a feature flag",
64
- description: "Create a feature flag and toggle it at least once.",
65
- order: 5,
66
- completion: {
67
- eventName: "flag.toggled",
68
- sourceModule: "@contractspec/lib.feature-flags"
69
- },
70
- xpReward: 20,
71
- metadata: { surface: "feature-flags" }
72
- },
73
- {
74
- id: "files_attachments",
75
- title: "Attach a file",
76
- description: "Upload and attach a file to any entity.",
77
- order: 6,
78
- completion: {
79
- eventName: "attachment.attached",
80
- sourceModule: "@contractspec/lib.files"
81
- },
82
- xpReward: 20,
83
- metadata: { surface: "files" }
84
- },
85
- {
86
- id: "usage_metering",
87
- title: "Record usage",
88
- description: "Emit a usage metric (regeneration, agent run, or similar).",
89
- order: 7,
90
- completion: {
91
- eventName: "usage.recorded",
92
- sourceModule: "@contractspec/lib.metering"
93
- },
94
- xpReward: 20,
95
- metadata: { surface: "metering" }
96
- }
97
- ],
98
- metadata: {
99
- surfacedIn: ["studio/learning", "platform/dev-center"]
100
- }
101
- };
102
- var platformLearningTracks = [
103
- platformPrimitivesTourTrack
104
- ];
105
- export {
106
- platformPrimitivesTourTrack,
107
- platformLearningTracks
108
- };
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:{xpBonus: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,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,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,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,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,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,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};