@playcademy/sandbox 0.3.15 → 0.3.16-beta.1

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 (3) hide show
  1. package/dist/cli.js +31 -13
  2. package/dist/server.js +31 -13
  3. package/package.json +2 -3
package/dist/cli.js CHANGED
@@ -1310,7 +1310,7 @@ var package_default;
1310
1310
  var init_package = __esm(() => {
1311
1311
  package_default = {
1312
1312
  name: "@playcademy/sandbox",
1313
- version: "0.3.15",
1313
+ version: "0.3.16-beta.1",
1314
1314
  description: "Local development server for Playcademy game development",
1315
1315
  type: "module",
1316
1316
  exports: {
@@ -1345,7 +1345,6 @@ var init_package = __esm(() => {
1345
1345
  build: "bun run build.ts",
1346
1346
  dev: "bun --watch src/cli",
1347
1347
  docs: "typedoc",
1348
- pub: "bun publish.ts",
1349
1348
  start: "bun src/cli"
1350
1349
  },
1351
1350
  dependencies: {
@@ -23810,7 +23809,7 @@ var init_provider2 = __esm(() => {
23810
23809
 
23811
23810
  // ../../node_modules/.bun/esbuild@0.25.10/node_modules/esbuild/lib/main.js
23812
23811
  var require_main2 = __commonJS((exports, module2) => {
23813
- var __dirname = "/Users/hbauer/work/projects/playcademy/node_modules/.bun/esbuild@0.25.10/node_modules/esbuild/lib", __filename = "/Users/hbauer/work/projects/playcademy/node_modules/.bun/esbuild@0.25.10/node_modules/esbuild/lib/main.js";
23812
+ var __dirname = "/home/runner/work/playcademy/playcademy/node_modules/.bun/esbuild@0.25.10/node_modules/esbuild/lib", __filename = "/home/runner/work/playcademy/playcademy/node_modules/.bun/esbuild@0.25.10/node_modules/esbuild/lib/main.js";
23814
23813
  var __defProp2 = Object.defineProperty;
23815
23814
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
23816
23815
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
@@ -30207,6 +30206,7 @@ class TimebackService {
30207
30206
  timingData,
30208
30207
  xpEarned,
30209
30208
  masteredUnits,
30209
+ extensions,
30210
30210
  user
30211
30211
  }) {
30212
30212
  const client = this.requireClient();
@@ -30226,6 +30226,7 @@ class TimebackService {
30226
30226
  sessionDurationSeconds: timingData.durationSeconds,
30227
30227
  xpEarned,
30228
30228
  masteredUnits,
30229
+ extensions,
30229
30230
  activityId: activityData.activityId,
30230
30231
  activityName: activityData.activityName,
30231
30232
  subject: activityData.subject,
@@ -91645,8 +91646,8 @@ var init_schemas11 = __esm(() => {
91645
91646
  activityData: exports_external.object({
91646
91647
  activityId: exports_external.string().min(1),
91647
91648
  activityName: exports_external.string().optional(),
91648
- grade: exports_external.number().int(),
91649
- subject: exports_external.string().min(1),
91649
+ grade: TimebackGradeSchema,
91650
+ subject: TimebackSubjectSchema,
91650
91651
  appName: exports_external.string().optional(),
91651
91652
  sensorUrl: exports_external.string().url().optional(),
91652
91653
  courseId: exports_external.string().optional(),
@@ -91661,7 +91662,8 @@ var init_schemas11 = __esm(() => {
91661
91662
  durationSeconds: exports_external.number().positive()
91662
91663
  }),
91663
91664
  xpEarned: exports_external.number().optional(),
91664
- masteredUnits: exports_external.number().nonnegative().optional()
91665
+ masteredUnits: exports_external.number().nonnegative().optional(),
91666
+ extensions: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
91665
91667
  });
91666
91668
  PopulateStudentRequestSchema = exports_external.object({
91667
91669
  firstName: exports_external.string().min(1).optional(),
@@ -92534,7 +92536,7 @@ var init_game_controller = __esm(() => {
92534
92536
  if (!isValidUUID(gameId)) {
92535
92537
  throw ApiError.unprocessableEntity("gameId must be a valid UUID format");
92536
92538
  }
92537
- logger45.debug("Getting game by ID", { userId: ctx.user.id, gameId });
92539
+ logger45.debug("Getting game by ID", { userId: ctx.user.id, gameId, launchId: ctx.launchId });
92538
92540
  return ctx.services.game.getById(gameId, ctx.user);
92539
92541
  });
92540
92542
  getBySlug = requireAuth(async (ctx) => {
@@ -92542,7 +92544,7 @@ var init_game_controller = __esm(() => {
92542
92544
  if (!slug2) {
92543
92545
  throw ApiError.badRequest("Missing game slug");
92544
92546
  }
92545
- logger45.debug("Getting game by slug", { userId: ctx.user.id, slug: slug2 });
92547
+ logger45.debug("Getting game by slug", { userId: ctx.user.id, slug: slug2, launchId: ctx.launchId });
92546
92548
  return ctx.services.game.getBySlug(slug2, ctx.user);
92547
92549
  });
92548
92550
  upsertBySlug = requireAuth(async (ctx) => {
@@ -93406,7 +93408,8 @@ var init_realtime_controller = __esm(() => {
93406
93408
  const gameIdOrSlug = ctx.params.gameId;
93407
93409
  logger55.debug("Generating token", {
93408
93410
  userId: ctx.user.id,
93409
- gameId: gameIdOrSlug || "global"
93411
+ gameId: gameIdOrSlug || "global",
93412
+ launchId: ctx.launchId
93410
93413
  });
93411
93414
  return ctx.services.realtime.generateToken(ctx.user, gameIdOrSlug);
93412
93415
  });
@@ -93526,7 +93529,7 @@ var init_session_controller = __esm(() => {
93526
93529
  if (!gameIdOrSlug) {
93527
93530
  throw ApiError.badRequest("Missing game ID or slug");
93528
93531
  }
93529
- logger58.debug("Starting session", { userId: ctx.user.id, gameIdOrSlug });
93532
+ logger58.debug("Starting session", { userId: ctx.user.id, gameIdOrSlug, launchId: ctx.launchId });
93530
93533
  return ctx.services.session.start(gameIdOrSlug, ctx.user.id);
93531
93534
  });
93532
93535
  end = requireAuth(async (ctx) => {
@@ -93538,7 +93541,12 @@ var init_session_controller = __esm(() => {
93538
93541
  if (!sessionId) {
93539
93542
  throw ApiError.badRequest("Missing session ID");
93540
93543
  }
93541
- logger58.debug("Ending session", { userId: ctx.user.id, gameIdOrSlug, sessionId });
93544
+ logger58.debug("Ending session", {
93545
+ userId: ctx.user.id,
93546
+ gameIdOrSlug,
93547
+ sessionId,
93548
+ launchId: ctx.launchId
93549
+ });
93542
93550
  return ctx.services.session.end(gameIdOrSlug, sessionId, ctx.user.id);
93543
93551
  });
93544
93552
  mintToken = requireAuth(async (ctx) => {
@@ -93546,7 +93554,7 @@ var init_session_controller = __esm(() => {
93546
93554
  if (!gameIdOrSlug) {
93547
93555
  throw ApiError.badRequest("Missing game ID or slug");
93548
93556
  }
93549
- logger58.debug("Minting token", { userId: ctx.user.id, gameIdOrSlug });
93557
+ logger58.debug("Minting token", { userId: ctx.user.id, gameIdOrSlug, launchId: ctx.launchId });
93550
93558
  return ctx.services.session.mintToken(gameIdOrSlug, ctx.user.id);
93551
93559
  });
93552
93560
  sessions2 = {
@@ -93950,7 +93958,16 @@ var init_timeback_controller = __esm(() => {
93950
93958
  }
93951
93959
  throw ApiError.badRequest("Invalid JSON body");
93952
93960
  }
93953
- const { gameId, studentId, activityData, scoreData, timingData, xpEarned, masteredUnits } = body2;
93961
+ const {
93962
+ gameId,
93963
+ studentId,
93964
+ activityData,
93965
+ scoreData,
93966
+ timingData,
93967
+ xpEarned,
93968
+ masteredUnits,
93969
+ extensions
93970
+ } = body2;
93954
93971
  logger62.debug("Ending activity", { userId: ctx.user.id, gameId });
93955
93972
  return ctx.services.timeback.endActivity({
93956
93973
  gameId,
@@ -93960,6 +93977,7 @@ var init_timeback_controller = __esm(() => {
93960
93977
  timingData,
93961
93978
  xpEarned,
93962
93979
  masteredUnits,
93980
+ extensions,
93963
93981
  user: ctx.user
93964
93982
  });
93965
93983
  });
package/dist/server.js CHANGED
@@ -1309,7 +1309,7 @@ var package_default;
1309
1309
  var init_package = __esm(() => {
1310
1310
  package_default = {
1311
1311
  name: "@playcademy/sandbox",
1312
- version: "0.3.15",
1312
+ version: "0.3.16-beta.1",
1313
1313
  description: "Local development server for Playcademy game development",
1314
1314
  type: "module",
1315
1315
  exports: {
@@ -1344,7 +1344,6 @@ var init_package = __esm(() => {
1344
1344
  build: "bun run build.ts",
1345
1345
  dev: "bun --watch src/cli",
1346
1346
  docs: "typedoc",
1347
- pub: "bun publish.ts",
1348
1347
  start: "bun src/cli"
1349
1348
  },
1350
1349
  dependencies: {
@@ -23809,7 +23808,7 @@ var init_provider2 = __esm(() => {
23809
23808
 
23810
23809
  // ../../node_modules/.bun/esbuild@0.25.10/node_modules/esbuild/lib/main.js
23811
23810
  var require_main2 = __commonJS((exports, module2) => {
23812
- var __dirname = "/Users/hbauer/work/projects/playcademy/node_modules/.bun/esbuild@0.25.10/node_modules/esbuild/lib", __filename = "/Users/hbauer/work/projects/playcademy/node_modules/.bun/esbuild@0.25.10/node_modules/esbuild/lib/main.js";
23811
+ var __dirname = "/home/runner/work/playcademy/playcademy/node_modules/.bun/esbuild@0.25.10/node_modules/esbuild/lib", __filename = "/home/runner/work/playcademy/playcademy/node_modules/.bun/esbuild@0.25.10/node_modules/esbuild/lib/main.js";
23813
23812
  var __defProp2 = Object.defineProperty;
23814
23813
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
23815
23814
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
@@ -30206,6 +30205,7 @@ class TimebackService {
30206
30205
  timingData,
30207
30206
  xpEarned,
30208
30207
  masteredUnits,
30208
+ extensions,
30209
30209
  user
30210
30210
  }) {
30211
30211
  const client = this.requireClient();
@@ -30225,6 +30225,7 @@ class TimebackService {
30225
30225
  sessionDurationSeconds: timingData.durationSeconds,
30226
30226
  xpEarned,
30227
30227
  masteredUnits,
30228
+ extensions,
30228
30229
  activityId: activityData.activityId,
30229
30230
  activityName: activityData.activityName,
30230
30231
  subject: activityData.subject,
@@ -91644,8 +91645,8 @@ var init_schemas11 = __esm(() => {
91644
91645
  activityData: exports_external.object({
91645
91646
  activityId: exports_external.string().min(1),
91646
91647
  activityName: exports_external.string().optional(),
91647
- grade: exports_external.number().int(),
91648
- subject: exports_external.string().min(1),
91648
+ grade: TimebackGradeSchema,
91649
+ subject: TimebackSubjectSchema,
91649
91650
  appName: exports_external.string().optional(),
91650
91651
  sensorUrl: exports_external.string().url().optional(),
91651
91652
  courseId: exports_external.string().optional(),
@@ -91660,7 +91661,8 @@ var init_schemas11 = __esm(() => {
91660
91661
  durationSeconds: exports_external.number().positive()
91661
91662
  }),
91662
91663
  xpEarned: exports_external.number().optional(),
91663
- masteredUnits: exports_external.number().nonnegative().optional()
91664
+ masteredUnits: exports_external.number().nonnegative().optional(),
91665
+ extensions: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
91664
91666
  });
91665
91667
  PopulateStudentRequestSchema = exports_external.object({
91666
91668
  firstName: exports_external.string().min(1).optional(),
@@ -92533,7 +92535,7 @@ var init_game_controller = __esm(() => {
92533
92535
  if (!isValidUUID(gameId)) {
92534
92536
  throw ApiError.unprocessableEntity("gameId must be a valid UUID format");
92535
92537
  }
92536
- logger45.debug("Getting game by ID", { userId: ctx.user.id, gameId });
92538
+ logger45.debug("Getting game by ID", { userId: ctx.user.id, gameId, launchId: ctx.launchId });
92537
92539
  return ctx.services.game.getById(gameId, ctx.user);
92538
92540
  });
92539
92541
  getBySlug = requireAuth(async (ctx) => {
@@ -92541,7 +92543,7 @@ var init_game_controller = __esm(() => {
92541
92543
  if (!slug2) {
92542
92544
  throw ApiError.badRequest("Missing game slug");
92543
92545
  }
92544
- logger45.debug("Getting game by slug", { userId: ctx.user.id, slug: slug2 });
92546
+ logger45.debug("Getting game by slug", { userId: ctx.user.id, slug: slug2, launchId: ctx.launchId });
92545
92547
  return ctx.services.game.getBySlug(slug2, ctx.user);
92546
92548
  });
92547
92549
  upsertBySlug = requireAuth(async (ctx) => {
@@ -93405,7 +93407,8 @@ var init_realtime_controller = __esm(() => {
93405
93407
  const gameIdOrSlug = ctx.params.gameId;
93406
93408
  logger55.debug("Generating token", {
93407
93409
  userId: ctx.user.id,
93408
- gameId: gameIdOrSlug || "global"
93410
+ gameId: gameIdOrSlug || "global",
93411
+ launchId: ctx.launchId
93409
93412
  });
93410
93413
  return ctx.services.realtime.generateToken(ctx.user, gameIdOrSlug);
93411
93414
  });
@@ -93525,7 +93528,7 @@ var init_session_controller = __esm(() => {
93525
93528
  if (!gameIdOrSlug) {
93526
93529
  throw ApiError.badRequest("Missing game ID or slug");
93527
93530
  }
93528
- logger58.debug("Starting session", { userId: ctx.user.id, gameIdOrSlug });
93531
+ logger58.debug("Starting session", { userId: ctx.user.id, gameIdOrSlug, launchId: ctx.launchId });
93529
93532
  return ctx.services.session.start(gameIdOrSlug, ctx.user.id);
93530
93533
  });
93531
93534
  end = requireAuth(async (ctx) => {
@@ -93537,7 +93540,12 @@ var init_session_controller = __esm(() => {
93537
93540
  if (!sessionId) {
93538
93541
  throw ApiError.badRequest("Missing session ID");
93539
93542
  }
93540
- logger58.debug("Ending session", { userId: ctx.user.id, gameIdOrSlug, sessionId });
93543
+ logger58.debug("Ending session", {
93544
+ userId: ctx.user.id,
93545
+ gameIdOrSlug,
93546
+ sessionId,
93547
+ launchId: ctx.launchId
93548
+ });
93541
93549
  return ctx.services.session.end(gameIdOrSlug, sessionId, ctx.user.id);
93542
93550
  });
93543
93551
  mintToken = requireAuth(async (ctx) => {
@@ -93545,7 +93553,7 @@ var init_session_controller = __esm(() => {
93545
93553
  if (!gameIdOrSlug) {
93546
93554
  throw ApiError.badRequest("Missing game ID or slug");
93547
93555
  }
93548
- logger58.debug("Minting token", { userId: ctx.user.id, gameIdOrSlug });
93556
+ logger58.debug("Minting token", { userId: ctx.user.id, gameIdOrSlug, launchId: ctx.launchId });
93549
93557
  return ctx.services.session.mintToken(gameIdOrSlug, ctx.user.id);
93550
93558
  });
93551
93559
  sessions2 = {
@@ -93949,7 +93957,16 @@ var init_timeback_controller = __esm(() => {
93949
93957
  }
93950
93958
  throw ApiError.badRequest("Invalid JSON body");
93951
93959
  }
93952
- const { gameId, studentId, activityData, scoreData, timingData, xpEarned, masteredUnits } = body2;
93960
+ const {
93961
+ gameId,
93962
+ studentId,
93963
+ activityData,
93964
+ scoreData,
93965
+ timingData,
93966
+ xpEarned,
93967
+ masteredUnits,
93968
+ extensions
93969
+ } = body2;
93953
93970
  logger62.debug("Ending activity", { userId: ctx.user.id, gameId });
93954
93971
  return ctx.services.timeback.endActivity({
93955
93972
  gameId,
@@ -93959,6 +93976,7 @@ var init_timeback_controller = __esm(() => {
93959
93976
  timingData,
93960
93977
  xpEarned,
93961
93978
  masteredUnits,
93979
+ extensions,
93962
93980
  user: ctx.user
93963
93981
  });
93964
93982
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playcademy/sandbox",
3
- "version": "0.3.15",
3
+ "version": "0.3.16-beta.1",
4
4
  "description": "Local development server for Playcademy game development",
5
5
  "type": "module",
6
6
  "exports": {
@@ -35,7 +35,6 @@
35
35
  "build": "bun run build.ts",
36
36
  "dev": "bun --watch src/cli",
37
37
  "docs": "typedoc",
38
- "pub": "bun publish.ts",
39
38
  "start": "bun src/cli"
40
39
  },
41
40
  "dependencies": {
@@ -57,7 +56,7 @@
57
56
  "@playcademy/constants": "0.0.1",
58
57
  "@playcademy/data": "0.0.1",
59
58
  "@playcademy/logger": "0.0.1",
60
- "@playcademy/sdk": "0.3.2",
59
+ "@playcademy/sdk": "0.3.5",
61
60
  "@playcademy/timeback": "0.0.1",
62
61
  "@playcademy/types": "0.0.1",
63
62
  "@playcademy/utils": "0.0.1",