@contractspec/example.learning-journey-platform-tour 0.0.0-canary-20260113162409

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 (56) hide show
  1. package/.turbo/turbo-build$colon$bundle.log +45 -0
  2. package/.turbo/turbo-build.log +46 -0
  3. package/CHANGELOG.md +330 -0
  4. package/LICENSE +21 -0
  5. package/README.md +43 -0
  6. package/dist/docs/index.d.ts +1 -0
  7. package/dist/docs/index.js +1 -0
  8. package/dist/docs/platform-tour.docblock.d.ts +1 -0
  9. package/dist/docs/platform-tour.docblock.js +42 -0
  10. package/dist/docs/platform-tour.docblock.js.map +1 -0
  11. package/dist/example.d.ts +7 -0
  12. package/dist/example.d.ts.map +1 -0
  13. package/dist/example.js +46 -0
  14. package/dist/example.js.map +1 -0
  15. package/dist/handlers/demo.handlers.d.ts +25 -0
  16. package/dist/handlers/demo.handlers.d.ts.map +1 -0
  17. package/dist/handlers/demo.handlers.js +27 -0
  18. package/dist/handlers/demo.handlers.js.map +1 -0
  19. package/dist/index.d.ts +7 -0
  20. package/dist/index.js +9 -0
  21. package/dist/learning-journey-platform-tour.feature.d.ts +12 -0
  22. package/dist/learning-journey-platform-tour.feature.d.ts.map +1 -0
  23. package/dist/learning-journey-platform-tour.feature.js +75 -0
  24. package/dist/learning-journey-platform-tour.feature.js.map +1 -0
  25. package/dist/operations/index.d.ts +271 -0
  26. package/dist/operations/index.d.ts.map +1 -0
  27. package/dist/operations/index.js +176 -0
  28. package/dist/operations/index.js.map +1 -0
  29. package/dist/presentations/index.d.ts +9 -0
  30. package/dist/presentations/index.d.ts.map +1 -0
  31. package/dist/presentations/index.js +55 -0
  32. package/dist/presentations/index.js.map +1 -0
  33. package/dist/tests/operations.test-spec.d.ts +7 -0
  34. package/dist/tests/operations.test-spec.d.ts.map +1 -0
  35. package/dist/tests/operations.test-spec.js +36 -0
  36. package/dist/tests/operations.test-spec.js.map +1 -0
  37. package/dist/track.d.ts +8 -0
  38. package/dist/track.d.ts.map +1 -0
  39. package/dist/track.js +106 -0
  40. package/dist/track.js.map +1 -0
  41. package/example.ts +1 -0
  42. package/package.json +66 -0
  43. package/src/docs/index.ts +1 -0
  44. package/src/docs/platform-tour.docblock.ts +40 -0
  45. package/src/example.ts +33 -0
  46. package/src/handlers/demo.handlers.ts +50 -0
  47. package/src/index.ts +7 -0
  48. package/src/learning-journey-platform-tour.feature.ts +66 -0
  49. package/src/operations/index.test.ts +49 -0
  50. package/src/operations/index.ts +122 -0
  51. package/src/presentations/index.ts +51 -0
  52. package/src/tests/operations.test-spec.ts +31 -0
  53. package/src/track.ts +106 -0
  54. package/tsconfig.json +9 -0
  55. package/tsconfig.tsbuildinfo +1 -0
  56. package/tsdown.config.js +17 -0
@@ -0,0 +1,31 @@
1
+ import { defineTestSpec } from '@contractspec/lib.contracts';
2
+
3
+ export const GetTrackTest = defineTestSpec({
4
+ meta: {
5
+ key: 'learningJourney.platformTour.getTrack.test',
6
+ version: '1.0.0',
7
+ stability: 'experimental',
8
+ owners: ['@example.learning-journey-platform-tour'],
9
+ description: 'Test for getting platform tour track',
10
+ tags: ['test'],
11
+ },
12
+ target: {
13
+ type: 'operation',
14
+ operation: {
15
+ key: 'learningJourney.platformTour.getTrack',
16
+ version: '1.0.0',
17
+ },
18
+ },
19
+ scenarios: [
20
+ {
21
+ key: 'success',
22
+ when: { operation: { key: 'learningJourney.platformTour.getTrack' } },
23
+ then: [{ type: 'expectOutput', match: {} }],
24
+ },
25
+ {
26
+ key: 'error',
27
+ when: { operation: { key: 'learningJourney.platformTour.getTrack' } },
28
+ then: [{ type: 'expectError' }],
29
+ },
30
+ ],
31
+ });
package/src/track.ts ADDED
@@ -0,0 +1,106 @@
1
+ import type { LearningJourneyTrackSpec } from '@contractspec/module.learning-journey/track-spec';
2
+
3
+ export const platformPrimitivesTourTrack: LearningJourneyTrackSpec = {
4
+ id: 'platform_primitives_tour',
5
+ productId: 'contractspec-platform',
6
+ name: 'Platform Primitives Tour',
7
+ description:
8
+ 'Hands-on tour across identity, audit, notifications, jobs, flags, files, and metering.',
9
+ targetUserSegment: 'platform_developer',
10
+ targetRole: 'developer',
11
+ totalXp: 140,
12
+ completionRewards: { xpBonus: 20, badgeKey: 'platform_primitives' },
13
+ steps: [
14
+ {
15
+ id: 'identity_rbac',
16
+ title: 'Create org and member',
17
+ description: 'Create an org and add at least one member.',
18
+ order: 1,
19
+ completion: {
20
+ eventName: 'org.member.added',
21
+ sourceModule: '@contractspec/lib.identity-rbac',
22
+ },
23
+ xpReward: 20,
24
+ metadata: { surface: 'identity' },
25
+ },
26
+ {
27
+ id: 'event_bus_audit',
28
+ title: 'Emit an auditable event',
29
+ description: 'Emit an event that lands in the audit log.',
30
+ order: 2,
31
+ completion: {
32
+ eventName: 'audit_log.created',
33
+ sourceModule: '@contractspec/module.audit-trail',
34
+ },
35
+ xpReward: 20,
36
+ metadata: { surface: 'bus+audit' },
37
+ },
38
+ {
39
+ id: 'notifications',
40
+ title: 'Send a notification',
41
+ description: 'Send yourself a notification and verify delivery.',
42
+ order: 3,
43
+ completion: {
44
+ eventName: 'notification.sent',
45
+ sourceModule: '@contractspec/module.notifications',
46
+ },
47
+ xpReward: 20,
48
+ metadata: { surface: 'notifications' },
49
+ },
50
+ {
51
+ id: 'jobs_scheduler',
52
+ title: 'Schedule and run a job',
53
+ description: 'Schedule a background job and let it run once.',
54
+ order: 4,
55
+ completion: {
56
+ eventName: 'job.completed',
57
+ sourceModule: '@contractspec/lib.jobs',
58
+ },
59
+ xpReward: 20,
60
+ metadata: { surface: 'jobs' },
61
+ },
62
+ {
63
+ id: 'feature_flags',
64
+ title: 'Create and toggle a feature flag',
65
+ description: 'Create a feature flag and toggle it at least once.',
66
+ order: 5,
67
+ completion: {
68
+ eventName: 'flag.toggled',
69
+ sourceModule: '@contractspec/lib.feature-flags',
70
+ },
71
+ xpReward: 20,
72
+ metadata: { surface: 'feature-flags' },
73
+ },
74
+ {
75
+ id: 'files_attachments',
76
+ title: 'Attach a file',
77
+ description: 'Upload and attach a file to any entity.',
78
+ order: 6,
79
+ completion: {
80
+ eventName: 'attachment.attached',
81
+ sourceModule: '@contractspec/lib.files',
82
+ },
83
+ xpReward: 20,
84
+ metadata: { surface: 'files' },
85
+ },
86
+ {
87
+ id: 'usage_metering',
88
+ title: 'Record usage',
89
+ description: 'Emit a usage metric (regeneration, agent run, or similar).',
90
+ order: 7,
91
+ completion: {
92
+ eventName: 'usage.recorded',
93
+ sourceModule: '@contractspec/lib.metering',
94
+ },
95
+ xpReward: 20,
96
+ metadata: { surface: 'metering' },
97
+ },
98
+ ],
99
+ metadata: {
100
+ surfacedIn: ['studio/learning', 'platform/dev-center'],
101
+ },
102
+ };
103
+
104
+ export const platformLearningTracks: LearningJourneyTrackSpec[] = [
105
+ platformPrimitivesTourTrack,
106
+ ];
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "@contractspec/tool.typescript/react-library.json",
3
+ "include": ["src"],
4
+ "exclude": ["node_modules"],
5
+ "compilerOptions": {
6
+ "rootDir": "src",
7
+ "outDir": "dist"
8
+ }
9
+ }