@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 @@
1
+ {"version":3,"file":"demo.handlers.js","names":[],"sources":["../../src/handlers/demo.handlers.ts"],"sourcesContent":["import { platformPrimitivesTourTrack } from '../track';\n\ninterface EmitParams {\n learnerId: string;\n occurredAt?: Date;\n payload?: Record<string, unknown>;\n}\n\ninterface LearningJourneyEvent {\n learnerId: string;\n name: string;\n occurredAt: Date;\n trackId: string;\n payload?: Record<string, unknown>;\n}\n\ntype RecordEvent = (event: LearningJourneyEvent) => unknown;\n\nexport const platformTourEvents = [\n 'org.member.added',\n 'audit_log.created',\n 'notification.sent',\n 'job.completed',\n 'flag.toggled',\n 'attachment.attached',\n 'usage.recorded',\n] as const;\n\nexport type PlatformEvent = (typeof platformTourEvents)[number];\n\nexport const emitPlatformTourEvent = (\n eventName: PlatformEvent,\n { learnerId, occurredAt = new Date(), payload }: EmitParams,\n record?: RecordEvent\n) => {\n const event: LearningJourneyEvent = {\n learnerId,\n name: eventName,\n occurredAt,\n payload,\n trackId: platformPrimitivesTourTrack.id,\n };\n return record ? record(event) : event;\n};\n\nexport const emitAllPlatformTourEvents = (\n params: EmitParams,\n record?: RecordEvent\n) =>\n platformTourEvents.map((name) => emitPlatformTourEvent(name, params, record));\n"],"mappings":";;;AAkBA,MAAa,qBAAqB;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAID,MAAa,yBACX,WACA,EAAE,WAAW,6BAAa,IAAI,MAAM,EAAE,WACtC,WACG;CACH,MAAM,QAA8B;EAClC;EACA,MAAM;EACN;EACA;EACA,SAAS,4BAA4B;EACtC;AACD,QAAO,SAAS,OAAO,MAAM,GAAG;;AAGlC,MAAa,6BACX,QACA,WAEA,mBAAmB,KAAK,SAAS,sBAAsB,MAAM,QAAQ,OAAO,CAAC"}
@@ -0,0 +1,7 @@
1
+ import example from "./example.js";
2
+ import { PlatformEvent, emitAllPlatformTourEvents, emitPlatformTourEvent, platformTourEvents } from "./handlers/demo.handlers.js";
3
+ import { platformLearningTracks, platformPrimitivesTourTrack } from "./track.js";
4
+ import { GetPlatformTourTrack, PlatformTourTrackModel, RecordPlatformTourEvent, platformTourContracts } from "./operations/index.js";
5
+ import { PlatformTourTrackPresentation, PlatformTourWidgetPresentation, platformTourPresentations } from "./presentations/index.js";
6
+ import { LearningJourneyPlatformTourFeature } from "./learning-journey-platform-tour.feature.js";
7
+ export { GetPlatformTourTrack, LearningJourneyPlatformTourFeature, PlatformEvent, PlatformTourTrackModel, PlatformTourTrackPresentation, PlatformTourWidgetPresentation, RecordPlatformTourEvent, emitAllPlatformTourEvents, emitPlatformTourEvent, example, platformLearningTracks, platformPrimitivesTourTrack, platformTourContracts, platformTourEvents, platformTourPresentations };
package/dist/index.js ADDED
@@ -0,0 +1,9 @@
1
+ import example_default from "./example.js";
2
+ import { platformLearningTracks, platformPrimitivesTourTrack } from "./track.js";
3
+ import "./docs/index.js";
4
+ import { GetPlatformTourTrack, PlatformTourTrackModel, RecordPlatformTourEvent, platformTourContracts } from "./operations/index.js";
5
+ import { emitAllPlatformTourEvents, emitPlatformTourEvent, platformTourEvents } from "./handlers/demo.handlers.js";
6
+ import { PlatformTourTrackPresentation, PlatformTourWidgetPresentation, platformTourPresentations } from "./presentations/index.js";
7
+ import { LearningJourneyPlatformTourFeature } from "./learning-journey-platform-tour.feature.js";
8
+
9
+ export { GetPlatformTourTrack, LearningJourneyPlatformTourFeature, PlatformTourTrackModel, PlatformTourTrackPresentation, PlatformTourWidgetPresentation, RecordPlatformTourEvent, emitAllPlatformTourEvents, emitPlatformTourEvent, example_default as example, platformLearningTracks, platformPrimitivesTourTrack, platformTourContracts, platformTourEvents, platformTourPresentations };
@@ -0,0 +1,12 @@
1
+ import * as _contractspec_lib_contracts3 from "@contractspec/lib.contracts";
2
+
3
+ //#region src/learning-journey-platform-tour.feature.d.ts
4
+
5
+ /**
6
+ * Learning Journey Platform Tour feature module that bundles
7
+ * platform-specific tour track operations and presentations.
8
+ */
9
+ declare const LearningJourneyPlatformTourFeature: _contractspec_lib_contracts3.FeatureModuleSpec;
10
+ //#endregion
11
+ export { LearningJourneyPlatformTourFeature };
12
+ //# sourceMappingURL=learning-journey-platform-tour.feature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"learning-journey-platform-tour.feature.d.ts","names":[],"sources":["../src/learning-journey-platform-tour.feature.ts"],"sourcesContent":[],"mappings":";;;;;;;AAWA;cAAa,oCAsDX,4BAAA,CAtD6C"}
@@ -0,0 +1,75 @@
1
+ import { defineFeature } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/learning-journey-platform-tour.feature.ts
4
+ /**
5
+ * Learning Journey Platform Tour Feature Module Specification
6
+ *
7
+ * Defines the feature module for platform primitives tour journey.
8
+ */
9
+ /**
10
+ * Learning Journey Platform Tour feature module that bundles
11
+ * platform-specific tour track operations and presentations.
12
+ */
13
+ const LearningJourneyPlatformTourFeature = defineFeature({
14
+ meta: {
15
+ key: "learning-journey-platform-tour",
16
+ version: "1.0.0",
17
+ title: "Learning Journey: Platform Tour",
18
+ description: "Platform primitives tour journey for exploring ContractSpec core features",
19
+ domain: "learning-journey",
20
+ owners: ["@examples.learning-journey.platform-tour"],
21
+ tags: [
22
+ "learning",
23
+ "platform",
24
+ "tour",
25
+ "journey"
26
+ ],
27
+ stability: "experimental"
28
+ },
29
+ operations: [{
30
+ key: "learningJourney.platformTour.recordEvent",
31
+ version: "1.0.0"
32
+ }, {
33
+ key: "learningJourney.platformTour.getTrack",
34
+ version: "1.0.0"
35
+ }],
36
+ events: [],
37
+ presentations: [{
38
+ key: "learning.journey.platform.track",
39
+ version: "1.0.0"
40
+ }, {
41
+ key: "learning.journey.platform.widget",
42
+ version: "1.0.0"
43
+ }],
44
+ opToPresentation: [{
45
+ op: {
46
+ key: "learningJourney.platformTour.getTrack",
47
+ version: "1.0.0"
48
+ },
49
+ pres: {
50
+ key: "learning.journey.platform.track",
51
+ version: "1.0.0"
52
+ }
53
+ }],
54
+ presentationsTargets: [{
55
+ key: "learning.journey.platform.track",
56
+ version: "1.0.0",
57
+ targets: [
58
+ "react",
59
+ "markdown",
60
+ "application/json"
61
+ ]
62
+ }, {
63
+ key: "learning.journey.platform.widget",
64
+ version: "1.0.0",
65
+ targets: ["react"]
66
+ }],
67
+ capabilities: { requires: [{
68
+ key: "identity",
69
+ version: "1.0.0"
70
+ }] }
71
+ });
72
+
73
+ //#endregion
74
+ export { LearningJourneyPlatformTourFeature };
75
+ //# sourceMappingURL=learning-journey-platform-tour.feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"learning-journey-platform-tour.feature.js","names":[],"sources":["../src/learning-journey-platform-tour.feature.ts"],"sourcesContent":["/**\n * Learning Journey Platform Tour Feature Module Specification\n *\n * Defines the feature module for platform primitives tour journey.\n */\nimport { defineFeature } from '@contractspec/lib.contracts';\n\n/**\n * Learning Journey Platform Tour feature module that bundles\n * platform-specific tour track operations and presentations.\n */\nexport const LearningJourneyPlatformTourFeature = defineFeature({\n meta: {\n key: 'learning-journey-platform-tour',\n version: '1.0.0',\n title: 'Learning Journey: Platform Tour',\n description:\n 'Platform primitives tour journey for exploring ContractSpec core features',\n domain: 'learning-journey',\n owners: ['@examples.learning-journey.platform-tour'],\n tags: ['learning', 'platform', 'tour', 'journey'],\n stability: 'experimental',\n },\n\n // All contract operations included in this feature\n operations: [\n { key: 'learningJourney.platformTour.recordEvent', version: '1.0.0' },\n { key: 'learningJourney.platformTour.getTrack', version: '1.0.0' },\n ],\n\n // Events emitted by this feature\n events: [],\n\n // Presentations associated with this feature\n presentations: [\n { key: 'learning.journey.platform.track', version: '1.0.0' },\n { key: 'learning.journey.platform.widget', version: '1.0.0' },\n ],\n\n // Link operations to their primary presentations\n opToPresentation: [\n {\n op: { key: 'learningJourney.platformTour.getTrack', version: '1.0.0' },\n pres: { key: 'learning.journey.platform.track', version: '1.0.0' },\n },\n ],\n\n // Target requirements for multi-surface rendering\n presentationsTargets: [\n {\n key: 'learning.journey.platform.track',\n version: '1.0.0',\n targets: ['react', 'markdown', 'application/json'],\n },\n {\n key: 'learning.journey.platform.widget',\n version: '1.0.0',\n targets: ['react'],\n },\n ],\n\n // Capability requirements\n capabilities: {\n requires: [{ key: 'identity', version: '1.0.0' }],\n },\n});\n"],"mappings":";;;;;;;;;;;;AAWA,MAAa,qCAAqC,cAAc;CAC9D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,QAAQ;EACR,QAAQ,CAAC,2CAA2C;EACpD,MAAM;GAAC;GAAY;GAAY;GAAQ;GAAU;EACjD,WAAW;EACZ;CAGD,YAAY,CACV;EAAE,KAAK;EAA4C,SAAS;EAAS,EACrE;EAAE,KAAK;EAAyC,SAAS;EAAS,CACnE;CAGD,QAAQ,EAAE;CAGV,eAAe,CACb;EAAE,KAAK;EAAmC,SAAS;EAAS,EAC5D;EAAE,KAAK;EAAoC,SAAS;EAAS,CAC9D;CAGD,kBAAkB,CAChB;EACE,IAAI;GAAE,KAAK;GAAyC,SAAS;GAAS;EACtE,MAAM;GAAE,KAAK;GAAmC,SAAS;GAAS;EACnE,CACF;CAGD,sBAAsB,CACpB;EACE,KAAK;EACL,SAAS;EACT,SAAS;GAAC;GAAS;GAAY;GAAmB;EACnD,EACD;EACE,KAAK;EACL,SAAS;EACT,SAAS,CAAC,QAAQ;EACnB,CACF;CAGD,cAAc,EACZ,UAAU,CAAC;EAAE,KAAK;EAAY,SAAS;EAAS,CAAC,EAClD;CACF,CAAC"}
@@ -0,0 +1,271 @@
1
+ import * as _contractspec_lib_contracts5 from "@contractspec/lib.contracts";
2
+ import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
3
+ import * as _contractspec_module_learning_journey_track_spec0 from "@contractspec/module.learning-journey/track-spec";
4
+
5
+ //#region src/operations/index.d.ts
6
+ declare const PlatformTourTrackModel: _contractspec_lib_schema0.SchemaModel<{
7
+ id: {
8
+ type: _contractspec_lib_schema0.FieldType<string, string>;
9
+ isOptional: false;
10
+ };
11
+ name: {
12
+ type: _contractspec_lib_schema0.FieldType<string, string>;
13
+ isOptional: false;
14
+ };
15
+ description: {
16
+ type: _contractspec_lib_schema0.FieldType<string, string>;
17
+ isOptional: true;
18
+ };
19
+ totalXp: {
20
+ type: _contractspec_lib_schema0.FieldType<number, number>;
21
+ isOptional: true;
22
+ };
23
+ completionXpBonus: {
24
+ type: _contractspec_lib_schema0.FieldType<number, number>;
25
+ isOptional: true;
26
+ };
27
+ completionBadgeKey: {
28
+ type: _contractspec_lib_schema0.FieldType<string, string>;
29
+ isOptional: true;
30
+ };
31
+ streakHoursWindow: {
32
+ type: _contractspec_lib_schema0.FieldType<number, number>;
33
+ isOptional: true;
34
+ };
35
+ streakBonusXp: {
36
+ type: _contractspec_lib_schema0.FieldType<number, number>;
37
+ isOptional: true;
38
+ };
39
+ steps: {
40
+ type: _contractspec_lib_schema0.SchemaModel<{
41
+ id: {
42
+ type: _contractspec_lib_schema0.FieldType<string, string>;
43
+ isOptional: false;
44
+ };
45
+ title: {
46
+ type: _contractspec_lib_schema0.FieldType<string, string>;
47
+ isOptional: false;
48
+ };
49
+ description: {
50
+ type: _contractspec_lib_schema0.FieldType<string, string>;
51
+ isOptional: true;
52
+ };
53
+ completionEvent: {
54
+ type: _contractspec_lib_schema0.FieldType<string, string>;
55
+ isOptional: false;
56
+ };
57
+ sourceModule: {
58
+ type: _contractspec_lib_schema0.FieldType<string, string>;
59
+ isOptional: true;
60
+ };
61
+ xpReward: {
62
+ type: _contractspec_lib_schema0.FieldType<number, number>;
63
+ isOptional: true;
64
+ };
65
+ order: {
66
+ type: _contractspec_lib_schema0.FieldType<number, number>;
67
+ isOptional: true;
68
+ };
69
+ }>;
70
+ isArray: true;
71
+ isOptional: false;
72
+ };
73
+ }>;
74
+ declare const GetPlatformTourTrack: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema0.SchemaModel<{}>, _contractspec_lib_schema0.SchemaModel<{
75
+ track: {
76
+ type: _contractspec_lib_schema0.SchemaModel<{
77
+ id: {
78
+ type: _contractspec_lib_schema0.FieldType<string, string>;
79
+ isOptional: false;
80
+ };
81
+ name: {
82
+ type: _contractspec_lib_schema0.FieldType<string, string>;
83
+ isOptional: false;
84
+ };
85
+ description: {
86
+ type: _contractspec_lib_schema0.FieldType<string, string>;
87
+ isOptional: true;
88
+ };
89
+ totalXp: {
90
+ type: _contractspec_lib_schema0.FieldType<number, number>;
91
+ isOptional: true;
92
+ };
93
+ completionXpBonus: {
94
+ type: _contractspec_lib_schema0.FieldType<number, number>;
95
+ isOptional: true;
96
+ };
97
+ completionBadgeKey: {
98
+ type: _contractspec_lib_schema0.FieldType<string, string>;
99
+ isOptional: true;
100
+ };
101
+ streakHoursWindow: {
102
+ type: _contractspec_lib_schema0.FieldType<number, number>;
103
+ isOptional: true;
104
+ };
105
+ streakBonusXp: {
106
+ type: _contractspec_lib_schema0.FieldType<number, number>;
107
+ isOptional: true;
108
+ };
109
+ steps: {
110
+ type: _contractspec_lib_schema0.SchemaModel<{
111
+ id: {
112
+ type: _contractspec_lib_schema0.FieldType<string, string>;
113
+ isOptional: false;
114
+ };
115
+ title: {
116
+ type: _contractspec_lib_schema0.FieldType<string, string>;
117
+ isOptional: false;
118
+ };
119
+ description: {
120
+ type: _contractspec_lib_schema0.FieldType<string, string>;
121
+ isOptional: true;
122
+ };
123
+ completionEvent: {
124
+ type: _contractspec_lib_schema0.FieldType<string, string>;
125
+ isOptional: false;
126
+ };
127
+ sourceModule: {
128
+ type: _contractspec_lib_schema0.FieldType<string, string>;
129
+ isOptional: true;
130
+ };
131
+ xpReward: {
132
+ type: _contractspec_lib_schema0.FieldType<number, number>;
133
+ isOptional: true;
134
+ };
135
+ order: {
136
+ type: _contractspec_lib_schema0.FieldType<number, number>;
137
+ isOptional: true;
138
+ };
139
+ }>;
140
+ isArray: true;
141
+ isOptional: false;
142
+ };
143
+ }>;
144
+ isOptional: false;
145
+ };
146
+ }>, undefined>;
147
+ declare const RecordPlatformTourEvent: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema0.SchemaModel<{
148
+ learnerId: {
149
+ type: _contractspec_lib_schema0.FieldType<string, string>;
150
+ isOptional: false;
151
+ };
152
+ eventName: {
153
+ type: _contractspec_lib_schema0.FieldType<string, string>;
154
+ isOptional: false;
155
+ };
156
+ payload: {
157
+ type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
158
+ isOptional: true;
159
+ };
160
+ occurredAt: {
161
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
162
+ isOptional: true;
163
+ };
164
+ }>, _contractspec_lib_schema0.SchemaModel<{
165
+ success: {
166
+ type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
167
+ isOptional: false;
168
+ };
169
+ }>, undefined>;
170
+ declare const platformTourContracts: {
171
+ GetPlatformTourTrack: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema0.SchemaModel<{}>, _contractspec_lib_schema0.SchemaModel<{
172
+ track: {
173
+ type: _contractspec_lib_schema0.SchemaModel<{
174
+ id: {
175
+ type: _contractspec_lib_schema0.FieldType<string, string>;
176
+ isOptional: false;
177
+ };
178
+ name: {
179
+ type: _contractspec_lib_schema0.FieldType<string, string>;
180
+ isOptional: false;
181
+ };
182
+ description: {
183
+ type: _contractspec_lib_schema0.FieldType<string, string>;
184
+ isOptional: true;
185
+ };
186
+ totalXp: {
187
+ type: _contractspec_lib_schema0.FieldType<number, number>;
188
+ isOptional: true;
189
+ };
190
+ completionXpBonus: {
191
+ type: _contractspec_lib_schema0.FieldType<number, number>;
192
+ isOptional: true;
193
+ };
194
+ completionBadgeKey: {
195
+ type: _contractspec_lib_schema0.FieldType<string, string>;
196
+ isOptional: true;
197
+ };
198
+ streakHoursWindow: {
199
+ type: _contractspec_lib_schema0.FieldType<number, number>;
200
+ isOptional: true;
201
+ };
202
+ streakBonusXp: {
203
+ type: _contractspec_lib_schema0.FieldType<number, number>;
204
+ isOptional: true;
205
+ };
206
+ steps: {
207
+ type: _contractspec_lib_schema0.SchemaModel<{
208
+ id: {
209
+ type: _contractspec_lib_schema0.FieldType<string, string>;
210
+ isOptional: false;
211
+ };
212
+ title: {
213
+ type: _contractspec_lib_schema0.FieldType<string, string>;
214
+ isOptional: false;
215
+ };
216
+ description: {
217
+ type: _contractspec_lib_schema0.FieldType<string, string>;
218
+ isOptional: true;
219
+ };
220
+ completionEvent: {
221
+ type: _contractspec_lib_schema0.FieldType<string, string>;
222
+ isOptional: false;
223
+ };
224
+ sourceModule: {
225
+ type: _contractspec_lib_schema0.FieldType<string, string>;
226
+ isOptional: true;
227
+ };
228
+ xpReward: {
229
+ type: _contractspec_lib_schema0.FieldType<number, number>;
230
+ isOptional: true;
231
+ };
232
+ order: {
233
+ type: _contractspec_lib_schema0.FieldType<number, number>;
234
+ isOptional: true;
235
+ };
236
+ }>;
237
+ isArray: true;
238
+ isOptional: false;
239
+ };
240
+ }>;
241
+ isOptional: false;
242
+ };
243
+ }>, undefined>;
244
+ RecordPlatformTourEvent: _contractspec_lib_contracts5.OperationSpec<_contractspec_lib_schema0.SchemaModel<{
245
+ learnerId: {
246
+ type: _contractspec_lib_schema0.FieldType<string, string>;
247
+ isOptional: false;
248
+ };
249
+ eventName: {
250
+ type: _contractspec_lib_schema0.FieldType<string, string>;
251
+ isOptional: false;
252
+ };
253
+ payload: {
254
+ type: _contractspec_lib_schema0.FieldType<unknown, unknown>;
255
+ isOptional: true;
256
+ };
257
+ occurredAt: {
258
+ type: _contractspec_lib_schema0.FieldType<Date, string>;
259
+ isOptional: true;
260
+ };
261
+ }>, _contractspec_lib_schema0.SchemaModel<{
262
+ success: {
263
+ type: _contractspec_lib_schema0.FieldType<boolean, boolean>;
264
+ isOptional: false;
265
+ };
266
+ }>, undefined>;
267
+ track: _contractspec_module_learning_journey_track_spec0.LearningJourneyTrackSpec;
268
+ };
269
+ //#endregion
270
+ export { GetPlatformTourTrack, PlatformTourTrackModel, RecordPlatformTourEvent, platformTourContracts };
271
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/operations/index.ts"],"sourcesContent":[],"mappings":";;;;;cAwBa,kDAAsB;;UAuBjC,yBAAA,CAAA;;;EAvBW,IAAA,EAAA;IAuBX,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;6CAvBiC,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;EAoDtB,CAAA;EAoBX,iBAAA,EAAA;IApB+B,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;;;;;;;;;;QAAA,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;QAAA,UAAA,EAAA,IAAA;MAsBpB,CAAA;MAiBX,eAAA,EAAA;;;;;iDAjBkC,CAAA,MAAA,EAAA,MAAA,CAAA;QAAA,UAAA,EAAA,IAAA;;;QAAA,IAAA,qCAAA,CAAA,MAAA,EAAA,MAAA,CAAA;QAmBvB,UAAA,EAIZ,IAAA;MAAA,CAAA;;;;;;;;;;cA7CY,sBAAoB,4BAAA,CAAA,cAoB/B,yBAAA,CApB+B,2CAAA;;;;cAAA,yBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsBpB,sDAAuB,wCAAA;;UAiBlC,yBAAA,CAAA;;;;;;;;;;;;;;;;;UAjBkC,yBAAA,CAAA;;;;cAmBvB;mEAIZ,yBAAA,CAAA"}
@@ -0,0 +1,176 @@
1
+ import { platformPrimitivesTourTrack } from "../track.js";
2
+ import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
3
+ import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
4
+
5
+ //#region src/operations/index.ts
6
+ const OWNERS = ["examples.learning-journey.platform-tour"];
7
+ const StepModel = defineSchemaModel({
8
+ name: "PlatformTourStep",
9
+ description: "Step metadata for platform primitives tour",
10
+ fields: {
11
+ id: {
12
+ type: ScalarTypeEnum.String_unsecure(),
13
+ isOptional: false
14
+ },
15
+ title: {
16
+ type: ScalarTypeEnum.String_unsecure(),
17
+ isOptional: false
18
+ },
19
+ description: {
20
+ type: ScalarTypeEnum.String_unsecure(),
21
+ isOptional: true
22
+ },
23
+ completionEvent: {
24
+ type: ScalarTypeEnum.String_unsecure(),
25
+ isOptional: false
26
+ },
27
+ sourceModule: {
28
+ type: ScalarTypeEnum.String_unsecure(),
29
+ isOptional: true
30
+ },
31
+ xpReward: {
32
+ type: ScalarTypeEnum.Int_unsecure(),
33
+ isOptional: true
34
+ },
35
+ order: {
36
+ type: ScalarTypeEnum.Int_unsecure(),
37
+ isOptional: true
38
+ }
39
+ }
40
+ });
41
+ const PlatformTourTrackModel = defineSchemaModel({
42
+ name: "PlatformTourTrack",
43
+ description: "Platform primitives tour track definition",
44
+ fields: {
45
+ id: {
46
+ type: ScalarTypeEnum.String_unsecure(),
47
+ isOptional: false
48
+ },
49
+ name: {
50
+ type: ScalarTypeEnum.String_unsecure(),
51
+ isOptional: false
52
+ },
53
+ description: {
54
+ type: ScalarTypeEnum.String_unsecure(),
55
+ isOptional: true
56
+ },
57
+ totalXp: {
58
+ type: ScalarTypeEnum.Int_unsecure(),
59
+ isOptional: true
60
+ },
61
+ completionXpBonus: {
62
+ type: ScalarTypeEnum.Int_unsecure(),
63
+ isOptional: true
64
+ },
65
+ completionBadgeKey: {
66
+ type: ScalarTypeEnum.String_unsecure(),
67
+ isOptional: true
68
+ },
69
+ streakHoursWindow: {
70
+ type: ScalarTypeEnum.Int_unsecure(),
71
+ isOptional: true
72
+ },
73
+ streakBonusXp: {
74
+ type: ScalarTypeEnum.Int_unsecure(),
75
+ isOptional: true
76
+ },
77
+ steps: {
78
+ type: StepModel,
79
+ isArray: true,
80
+ isOptional: false
81
+ }
82
+ }
83
+ });
84
+ const TrackResponseModel = defineSchemaModel({
85
+ name: "PlatformTourTrackResponse",
86
+ description: "Response wrapper for platform tour track",
87
+ fields: { track: {
88
+ type: PlatformTourTrackModel,
89
+ isOptional: false
90
+ } }
91
+ });
92
+ const RecordDemoEventInput = defineSchemaModel({
93
+ name: "PlatformTourRecordEventInput",
94
+ description: "Emit a demo event to advance platform tour steps",
95
+ fields: {
96
+ learnerId: {
97
+ type: ScalarTypeEnum.String_unsecure(),
98
+ isOptional: false
99
+ },
100
+ eventName: {
101
+ type: ScalarTypeEnum.String_unsecure(),
102
+ isOptional: false
103
+ },
104
+ payload: {
105
+ type: ScalarTypeEnum.JSON(),
106
+ isOptional: true
107
+ },
108
+ occurredAt: {
109
+ type: ScalarTypeEnum.DateTime(),
110
+ isOptional: true
111
+ }
112
+ }
113
+ });
114
+ const SuccessModel = defineSchemaModel({
115
+ name: "PlatformTourSuccess",
116
+ description: "Generic success response",
117
+ fields: { success: {
118
+ type: ScalarTypeEnum.Boolean(),
119
+ isOptional: false
120
+ } }
121
+ });
122
+ const GetPlatformTourTrack = defineQuery({
123
+ meta: {
124
+ key: "learningJourney.platformTour.getTrack",
125
+ version: "1.0.0",
126
+ stability: "experimental",
127
+ owners: [...OWNERS],
128
+ tags: [
129
+ "learning",
130
+ "platform",
131
+ "tour"
132
+ ],
133
+ description: "Fetch platform primitives tour track definition.",
134
+ goal: "Expose track metadata to UIs and templates.",
135
+ context: "Called by Studio/Playground to render journey steps."
136
+ },
137
+ io: {
138
+ input: defineSchemaModel({
139
+ name: "PlatformTourTrackInput",
140
+ description: "Track input",
141
+ fields: {}
142
+ }),
143
+ output: TrackResponseModel
144
+ },
145
+ policy: { auth: "user" }
146
+ });
147
+ const RecordPlatformTourEvent = defineCommand({
148
+ meta: {
149
+ key: "learningJourney.platformTour.recordEvent",
150
+ version: "1.0.0",
151
+ stability: "experimental",
152
+ owners: [...OWNERS],
153
+ tags: [
154
+ "learning",
155
+ "platform",
156
+ "tour"
157
+ ],
158
+ description: "Record an event to advance platform tour progress.",
159
+ goal: "Advance steps via domain events in demo/sandbox contexts.",
160
+ context: "Called by handlers or demo scripts to emit step completion events."
161
+ },
162
+ io: {
163
+ input: RecordDemoEventInput,
164
+ output: SuccessModel
165
+ },
166
+ policy: { auth: "user" }
167
+ });
168
+ const platformTourContracts = {
169
+ GetPlatformTourTrack,
170
+ RecordPlatformTourEvent,
171
+ track: platformPrimitivesTourTrack
172
+ };
173
+
174
+ //#endregion
175
+ export { GetPlatformTourTrack, PlatformTourTrackModel, RecordPlatformTourEvent, platformTourContracts };
176
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/operations/index.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@contractspec/lib.schema';\nimport { defineCommand, defineQuery } from '@contractspec/lib.contracts';\n\nimport { platformPrimitivesTourTrack } from '../track';\n\nconst OWNERS = ['examples.learning-journey.platform-tour'] as const;\n\nconst StepModel = defineSchemaModel({\n name: 'PlatformTourStep',\n description: 'Step metadata for platform primitives tour',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n title: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n completionEvent: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n sourceModule: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n xpReward: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n order: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nexport const PlatformTourTrackModel = defineSchemaModel({\n name: 'PlatformTourTrack',\n description: 'Platform primitives tour track definition',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n totalXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n completionXpBonus: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n },\n completionBadgeKey: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n streakHoursWindow: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n },\n streakBonusXp: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n steps: { type: StepModel, isArray: true, isOptional: false },\n },\n});\n\nconst TrackResponseModel = defineSchemaModel({\n name: 'PlatformTourTrackResponse',\n description: 'Response wrapper for platform tour track',\n fields: {\n track: { type: PlatformTourTrackModel, isOptional: false },\n },\n});\n\nconst RecordDemoEventInput = defineSchemaModel({\n name: 'PlatformTourRecordEventInput',\n description: 'Emit a demo event to advance platform tour steps',\n fields: {\n learnerId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n payload: { type: ScalarTypeEnum.JSON(), isOptional: true },\n occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n\nconst SuccessModel = defineSchemaModel({\n name: 'PlatformTourSuccess',\n description: 'Generic success response',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\nexport const GetPlatformTourTrack = defineQuery({\n meta: {\n key: 'learningJourney.platformTour.getTrack',\n version: '1.0.0',\n stability: 'experimental',\n owners: [...OWNERS],\n tags: ['learning', 'platform', 'tour'],\n description: 'Fetch platform primitives tour track definition.',\n goal: 'Expose track metadata to UIs and templates.',\n context: 'Called by Studio/Playground to render journey steps.',\n },\n io: {\n input: defineSchemaModel({\n name: 'PlatformTourTrackInput',\n description: 'Track input',\n fields: {},\n }),\n output: TrackResponseModel,\n },\n policy: { auth: 'user' },\n});\n\nexport const RecordPlatformTourEvent = defineCommand({\n meta: {\n key: 'learningJourney.platformTour.recordEvent',\n version: '1.0.0',\n stability: 'experimental',\n owners: [...OWNERS],\n tags: ['learning', 'platform', 'tour'],\n description: 'Record an event to advance platform tour progress.',\n goal: 'Advance steps via domain events in demo/sandbox contexts.',\n context:\n 'Called by handlers or demo scripts to emit step completion events.',\n },\n io: {\n input: RecordDemoEventInput,\n output: SuccessModel,\n },\n policy: { auth: 'user' },\n});\n\nexport const platformTourContracts = {\n GetPlatformTourTrack,\n RecordPlatformTourEvent,\n track: platformPrimitivesTourTrack,\n};\n"],"mappings":";;;;;AAKA,MAAM,SAAS,CAAC,0CAA0C;AAE1D,MAAM,YAAY,kBAAkB;CAClC,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,OAAO;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACpE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,iBAAiB;GACf,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,cAAc;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EAC1E,UAAU;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EACnE,OAAO;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EACjE;CACF,CAAC;AAEF,MAAa,yBAAyB,kBAAkB;CACtD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,aAAa;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,SAAS;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EAClE,mBAAmB;GACjB,MAAM,eAAe,cAAc;GACnC,YAAY;GACb;EACD,oBAAoB;GAClB,MAAM,eAAe,iBAAiB;GACtC,YAAY;GACb;EACD,mBAAmB;GACjB,MAAM,eAAe,cAAc;GACnC,YAAY;GACb;EACD,eAAe;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EACxE,OAAO;GAAE,MAAM;GAAW,SAAS;GAAM,YAAY;GAAO;EAC7D;CACF,CAAC;AAEF,MAAM,qBAAqB,kBAAkB;CAC3C,MAAM;CACN,aAAa;CACb,QAAQ,EACN,OAAO;EAAE,MAAM;EAAwB,YAAY;EAAO,EAC3D;CACF,CAAC;AAEF,MAAM,uBAAuB,kBAAkB;CAC7C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,SAAS;GAAE,MAAM,eAAe,MAAM;GAAE,YAAY;GAAM;EAC1D,YAAY;GAAE,MAAM,eAAe,UAAU;GAAE,YAAY;GAAM;EAClE;CACF,CAAC;AAEF,MAAM,eAAe,kBAAkB;CACrC,MAAM;CACN,aAAa;CACb,QAAQ,EACN,SAAS;EAAE,MAAM,eAAe,SAAS;EAAE,YAAY;EAAO,EAC/D;CACF,CAAC;AAEF,MAAa,uBAAuB,YAAY;CAC9C,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAY;GAAY;GAAO;EACtC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO,kBAAkB;GACvB,MAAM;GACN,aAAa;GACb,QAAQ,EAAE;GACX,CAAC;EACF,QAAQ;EACT;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC;AAEF,MAAa,0BAA0B,cAAc;CACnD,MAAM;EACJ,KAAK;EACL,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAY;GAAY;GAAO;EACtC,aAAa;EACb,MAAM;EACN,SACE;EACH;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EAAE,MAAM,QAAQ;CACzB,CAAC;AAEF,MAAa,wBAAwB;CACnC;CACA;CACA,OAAO;CACR"}
@@ -0,0 +1,9 @@
1
+ import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
+
3
+ //#region src/presentations/index.d.ts
4
+ declare const PlatformTourTrackPresentation: _contractspec_lib_contracts0.PresentationSpec;
5
+ declare const PlatformTourWidgetPresentation: _contractspec_lib_contracts0.PresentationSpec;
6
+ declare const platformTourPresentations: _contractspec_lib_contracts0.PresentationSpec[];
7
+ //#endregion
8
+ export { PlatformTourTrackPresentation, PlatformTourWidgetPresentation, platformTourPresentations };
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/presentations/index.ts"],"sourcesContent":[],"mappings":";;;cAgBa,+BAcX,4BAAA,CAdwC;cAgB7B,gCAaX,4BAAA,CAbyC;cAe9B,2BAGZ,4BAAA,CAHqC,gBAAA"}
@@ -0,0 +1,55 @@
1
+ import { PlatformTourTrackModel } from "../operations/index.js";
2
+ import { StabilityEnum, definePresentation } from "@contractspec/lib.contracts";
3
+
4
+ //#region src/presentations/index.ts
5
+ const baseMeta = {
6
+ domain: "learning-journey",
7
+ title: "Platform Tour",
8
+ owners: ["@examples.learning-journey.platform-tour"],
9
+ tags: [
10
+ "learning",
11
+ "platform",
12
+ "tour"
13
+ ],
14
+ stability: StabilityEnum.Experimental,
15
+ goal: "Visualize platform tour progress",
16
+ context: "Used in platform tour dashboard and widgets"
17
+ };
18
+ const PlatformTourTrackPresentation = definePresentation({
19
+ meta: {
20
+ key: "learning.journey.platform.track",
21
+ version: "1.0.0",
22
+ description: "Platform primitives tour track detail",
23
+ ...baseMeta
24
+ },
25
+ source: {
26
+ type: "component",
27
+ framework: "react",
28
+ componentKey: "LearningTrackDetail",
29
+ props: PlatformTourTrackModel
30
+ },
31
+ targets: [
32
+ "react",
33
+ "markdown",
34
+ "application/json"
35
+ ]
36
+ });
37
+ const PlatformTourWidgetPresentation = definePresentation({
38
+ meta: {
39
+ key: "learning.journey.platform.widget",
40
+ version: "1.0.0",
41
+ description: "Compact widget for platform tour progress",
42
+ ...baseMeta
43
+ },
44
+ source: {
45
+ type: "component",
46
+ framework: "react",
47
+ componentKey: "LearningTrackProgressWidget"
48
+ },
49
+ targets: ["react"]
50
+ });
51
+ const platformTourPresentations = [PlatformTourTrackPresentation, PlatformTourWidgetPresentation];
52
+
53
+ //#endregion
54
+ export { PlatformTourTrackPresentation, PlatformTourWidgetPresentation, platformTourPresentations };
55
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/presentations/index.ts"],"sourcesContent":["import { definePresentation, StabilityEnum, type PresentationSpecMeta } from '@contractspec/lib.contracts';\nimport { PlatformTourTrackModel } from '../operations';\n\nconst baseMeta: Pick<\n PresentationSpecMeta,\n 'domain' | 'owners' | 'tags' | 'title' | 'stability' | 'goal' | 'context'\n> = {\n domain: 'learning-journey',\n title: 'Platform Tour',\n owners: ['@examples.learning-journey.platform-tour'],\n tags: ['learning', 'platform', 'tour'],\n stability: StabilityEnum.Experimental,\n goal: 'Visualize platform tour progress',\n context: 'Used in platform tour dashboard and widgets',\n};\n\nexport const PlatformTourTrackPresentation = definePresentation({\n meta: {\n key: 'learning.journey.platform.track',\n version: '1.0.0',\n description: 'Platform primitives tour track detail',\n ...baseMeta,\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'LearningTrackDetail',\n props: PlatformTourTrackModel,\n },\n targets: ['react', 'markdown', 'application/json'],\n});\n\nexport const PlatformTourWidgetPresentation = definePresentation({\n meta: {\n key: 'learning.journey.platform.widget',\n version: '1.0.0',\n description: 'Compact widget for platform tour progress',\n ...baseMeta,\n },\n source: {\n type: 'component',\n framework: 'react',\n componentKey: 'LearningTrackProgressWidget',\n },\n targets: ['react'],\n});\n\nexport const platformTourPresentations = [\n PlatformTourTrackPresentation,\n PlatformTourWidgetPresentation,\n];\n"],"mappings":";;;;AAGA,MAAM,WAGF;CACF,QAAQ;CACR,OAAO;CACP,QAAQ,CAAC,2CAA2C;CACpD,MAAM;EAAC;EAAY;EAAY;EAAO;CACtC,WAAW,cAAc;CACzB,MAAM;CACN,SAAS;CACV;AAED,MAAa,gCAAgC,mBAAmB;CAC9D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,GAAG;EACJ;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACd,OAAO;EACR;CACD,SAAS;EAAC;EAAS;EAAY;EAAmB;CACnD,CAAC;AAEF,MAAa,iCAAiC,mBAAmB;CAC/D,MAAM;EACJ,KAAK;EACL,SAAS;EACT,aAAa;EACb,GAAG;EACJ;CACD,QAAQ;EACN,MAAM;EACN,WAAW;EACX,cAAc;EACf;CACD,SAAS,CAAC,QAAQ;CACnB,CAAC;AAEF,MAAa,4BAA4B,CACvC,+BACA,+BACD"}
@@ -0,0 +1,7 @@
1
+ import * as _contractspec_lib_contracts4 from "@contractspec/lib.contracts";
2
+
3
+ //#region src/tests/operations.test-spec.d.ts
4
+ declare const GetTrackTest: _contractspec_lib_contracts4.TestSpec;
5
+ //#endregion
6
+ export { GetTrackTest };
7
+ //# sourceMappingURL=operations.test-spec.d.ts.map