@playcademy/sandbox 0.3.15 → 0.3.16-beta.2

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 -14
  2. package/dist/server.js +31 -14
  3. package/package.json +1 -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.2",
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: {
@@ -1367,7 +1366,6 @@ var init_package = __esm(() => {
1367
1366
  "@playcademy/constants": "workspace:*",
1368
1367
  "@playcademy/data": "workspace:*",
1369
1368
  "@playcademy/logger": "workspace:*",
1370
- "@playcademy/sdk": "workspace:*",
1371
1369
  "@playcademy/timeback": "workspace:*",
1372
1370
  "@playcademy/types": "workspace:*",
1373
1371
  "@playcademy/utils": "workspace:*",
@@ -23810,7 +23808,7 @@ var init_provider2 = __esm(() => {
23810
23808
 
23811
23809
  // ../../node_modules/.bun/esbuild@0.25.10/node_modules/esbuild/lib/main.js
23812
23810
  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";
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";
23814
23812
  var __defProp2 = Object.defineProperty;
23815
23813
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
23816
23814
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
@@ -30207,6 +30205,7 @@ class TimebackService {
30207
30205
  timingData,
30208
30206
  xpEarned,
30209
30207
  masteredUnits,
30208
+ extensions,
30210
30209
  user
30211
30210
  }) {
30212
30211
  const client = this.requireClient();
@@ -30226,6 +30225,7 @@ class TimebackService {
30226
30225
  sessionDurationSeconds: timingData.durationSeconds,
30227
30226
  xpEarned,
30228
30227
  masteredUnits,
30228
+ extensions,
30229
30229
  activityId: activityData.activityId,
30230
30230
  activityName: activityData.activityName,
30231
30231
  subject: activityData.subject,
@@ -91645,8 +91645,8 @@ var init_schemas11 = __esm(() => {
91645
91645
  activityData: exports_external.object({
91646
91646
  activityId: exports_external.string().min(1),
91647
91647
  activityName: exports_external.string().optional(),
91648
- grade: exports_external.number().int(),
91649
- subject: exports_external.string().min(1),
91648
+ grade: TimebackGradeSchema,
91649
+ subject: TimebackSubjectSchema,
91650
91650
  appName: exports_external.string().optional(),
91651
91651
  sensorUrl: exports_external.string().url().optional(),
91652
91652
  courseId: exports_external.string().optional(),
@@ -91661,7 +91661,8 @@ var init_schemas11 = __esm(() => {
91661
91661
  durationSeconds: exports_external.number().positive()
91662
91662
  }),
91663
91663
  xpEarned: exports_external.number().optional(),
91664
- 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()
91665
91666
  });
91666
91667
  PopulateStudentRequestSchema = exports_external.object({
91667
91668
  firstName: exports_external.string().min(1).optional(),
@@ -92534,7 +92535,7 @@ var init_game_controller = __esm(() => {
92534
92535
  if (!isValidUUID(gameId)) {
92535
92536
  throw ApiError.unprocessableEntity("gameId must be a valid UUID format");
92536
92537
  }
92537
- 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 });
92538
92539
  return ctx.services.game.getById(gameId, ctx.user);
92539
92540
  });
92540
92541
  getBySlug = requireAuth(async (ctx) => {
@@ -92542,7 +92543,7 @@ var init_game_controller = __esm(() => {
92542
92543
  if (!slug2) {
92543
92544
  throw ApiError.badRequest("Missing game slug");
92544
92545
  }
92545
- 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 });
92546
92547
  return ctx.services.game.getBySlug(slug2, ctx.user);
92547
92548
  });
92548
92549
  upsertBySlug = requireAuth(async (ctx) => {
@@ -93406,7 +93407,8 @@ var init_realtime_controller = __esm(() => {
93406
93407
  const gameIdOrSlug = ctx.params.gameId;
93407
93408
  logger55.debug("Generating token", {
93408
93409
  userId: ctx.user.id,
93409
- gameId: gameIdOrSlug || "global"
93410
+ gameId: gameIdOrSlug || "global",
93411
+ launchId: ctx.launchId
93410
93412
  });
93411
93413
  return ctx.services.realtime.generateToken(ctx.user, gameIdOrSlug);
93412
93414
  });
@@ -93526,7 +93528,7 @@ var init_session_controller = __esm(() => {
93526
93528
  if (!gameIdOrSlug) {
93527
93529
  throw ApiError.badRequest("Missing game ID or slug");
93528
93530
  }
93529
- logger58.debug("Starting session", { userId: ctx.user.id, gameIdOrSlug });
93531
+ logger58.debug("Starting session", { userId: ctx.user.id, gameIdOrSlug, launchId: ctx.launchId });
93530
93532
  return ctx.services.session.start(gameIdOrSlug, ctx.user.id);
93531
93533
  });
93532
93534
  end = requireAuth(async (ctx) => {
@@ -93538,7 +93540,12 @@ var init_session_controller = __esm(() => {
93538
93540
  if (!sessionId) {
93539
93541
  throw ApiError.badRequest("Missing session ID");
93540
93542
  }
93541
- 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
+ });
93542
93549
  return ctx.services.session.end(gameIdOrSlug, sessionId, ctx.user.id);
93543
93550
  });
93544
93551
  mintToken = requireAuth(async (ctx) => {
@@ -93546,7 +93553,7 @@ var init_session_controller = __esm(() => {
93546
93553
  if (!gameIdOrSlug) {
93547
93554
  throw ApiError.badRequest("Missing game ID or slug");
93548
93555
  }
93549
- logger58.debug("Minting token", { userId: ctx.user.id, gameIdOrSlug });
93556
+ logger58.debug("Minting token", { userId: ctx.user.id, gameIdOrSlug, launchId: ctx.launchId });
93550
93557
  return ctx.services.session.mintToken(gameIdOrSlug, ctx.user.id);
93551
93558
  });
93552
93559
  sessions2 = {
@@ -93950,7 +93957,16 @@ var init_timeback_controller = __esm(() => {
93950
93957
  }
93951
93958
  throw ApiError.badRequest("Invalid JSON body");
93952
93959
  }
93953
- 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;
93954
93970
  logger62.debug("Ending activity", { userId: ctx.user.id, gameId });
93955
93971
  return ctx.services.timeback.endActivity({
93956
93972
  gameId,
@@ -93960,6 +93976,7 @@ var init_timeback_controller = __esm(() => {
93960
93976
  timingData,
93961
93977
  xpEarned,
93962
93978
  masteredUnits,
93979
+ extensions,
93963
93980
  user: ctx.user
93964
93981
  });
93965
93982
  });
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.2",
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: {
@@ -1366,7 +1365,6 @@ var init_package = __esm(() => {
1366
1365
  "@playcademy/constants": "workspace:*",
1367
1366
  "@playcademy/data": "workspace:*",
1368
1367
  "@playcademy/logger": "workspace:*",
1369
- "@playcademy/sdk": "workspace:*",
1370
1368
  "@playcademy/timeback": "workspace:*",
1371
1369
  "@playcademy/types": "workspace:*",
1372
1370
  "@playcademy/utils": "workspace:*",
@@ -23809,7 +23807,7 @@ var init_provider2 = __esm(() => {
23809
23807
 
23810
23808
  // ../../node_modules/.bun/esbuild@0.25.10/node_modules/esbuild/lib/main.js
23811
23809
  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";
23810
+ 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
23811
  var __defProp2 = Object.defineProperty;
23814
23812
  var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
23815
23813
  var __getOwnPropNames2 = Object.getOwnPropertyNames;
@@ -30206,6 +30204,7 @@ class TimebackService {
30206
30204
  timingData,
30207
30205
  xpEarned,
30208
30206
  masteredUnits,
30207
+ extensions,
30209
30208
  user
30210
30209
  }) {
30211
30210
  const client = this.requireClient();
@@ -30225,6 +30224,7 @@ class TimebackService {
30225
30224
  sessionDurationSeconds: timingData.durationSeconds,
30226
30225
  xpEarned,
30227
30226
  masteredUnits,
30227
+ extensions,
30228
30228
  activityId: activityData.activityId,
30229
30229
  activityName: activityData.activityName,
30230
30230
  subject: activityData.subject,
@@ -91644,8 +91644,8 @@ var init_schemas11 = __esm(() => {
91644
91644
  activityData: exports_external.object({
91645
91645
  activityId: exports_external.string().min(1),
91646
91646
  activityName: exports_external.string().optional(),
91647
- grade: exports_external.number().int(),
91648
- subject: exports_external.string().min(1),
91647
+ grade: TimebackGradeSchema,
91648
+ subject: TimebackSubjectSchema,
91649
91649
  appName: exports_external.string().optional(),
91650
91650
  sensorUrl: exports_external.string().url().optional(),
91651
91651
  courseId: exports_external.string().optional(),
@@ -91660,7 +91660,8 @@ var init_schemas11 = __esm(() => {
91660
91660
  durationSeconds: exports_external.number().positive()
91661
91661
  }),
91662
91662
  xpEarned: exports_external.number().optional(),
91663
- masteredUnits: exports_external.number().nonnegative().optional()
91663
+ masteredUnits: exports_external.number().nonnegative().optional(),
91664
+ extensions: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
91664
91665
  });
91665
91666
  PopulateStudentRequestSchema = exports_external.object({
91666
91667
  firstName: exports_external.string().min(1).optional(),
@@ -92533,7 +92534,7 @@ var init_game_controller = __esm(() => {
92533
92534
  if (!isValidUUID(gameId)) {
92534
92535
  throw ApiError.unprocessableEntity("gameId must be a valid UUID format");
92535
92536
  }
92536
- logger45.debug("Getting game by ID", { userId: ctx.user.id, gameId });
92537
+ logger45.debug("Getting game by ID", { userId: ctx.user.id, gameId, launchId: ctx.launchId });
92537
92538
  return ctx.services.game.getById(gameId, ctx.user);
92538
92539
  });
92539
92540
  getBySlug = requireAuth(async (ctx) => {
@@ -92541,7 +92542,7 @@ var init_game_controller = __esm(() => {
92541
92542
  if (!slug2) {
92542
92543
  throw ApiError.badRequest("Missing game slug");
92543
92544
  }
92544
- logger45.debug("Getting game by slug", { userId: ctx.user.id, slug: slug2 });
92545
+ logger45.debug("Getting game by slug", { userId: ctx.user.id, slug: slug2, launchId: ctx.launchId });
92545
92546
  return ctx.services.game.getBySlug(slug2, ctx.user);
92546
92547
  });
92547
92548
  upsertBySlug = requireAuth(async (ctx) => {
@@ -93405,7 +93406,8 @@ var init_realtime_controller = __esm(() => {
93405
93406
  const gameIdOrSlug = ctx.params.gameId;
93406
93407
  logger55.debug("Generating token", {
93407
93408
  userId: ctx.user.id,
93408
- gameId: gameIdOrSlug || "global"
93409
+ gameId: gameIdOrSlug || "global",
93410
+ launchId: ctx.launchId
93409
93411
  });
93410
93412
  return ctx.services.realtime.generateToken(ctx.user, gameIdOrSlug);
93411
93413
  });
@@ -93525,7 +93527,7 @@ var init_session_controller = __esm(() => {
93525
93527
  if (!gameIdOrSlug) {
93526
93528
  throw ApiError.badRequest("Missing game ID or slug");
93527
93529
  }
93528
- logger58.debug("Starting session", { userId: ctx.user.id, gameIdOrSlug });
93530
+ logger58.debug("Starting session", { userId: ctx.user.id, gameIdOrSlug, launchId: ctx.launchId });
93529
93531
  return ctx.services.session.start(gameIdOrSlug, ctx.user.id);
93530
93532
  });
93531
93533
  end = requireAuth(async (ctx) => {
@@ -93537,7 +93539,12 @@ var init_session_controller = __esm(() => {
93537
93539
  if (!sessionId) {
93538
93540
  throw ApiError.badRequest("Missing session ID");
93539
93541
  }
93540
- logger58.debug("Ending session", { userId: ctx.user.id, gameIdOrSlug, sessionId });
93542
+ logger58.debug("Ending session", {
93543
+ userId: ctx.user.id,
93544
+ gameIdOrSlug,
93545
+ sessionId,
93546
+ launchId: ctx.launchId
93547
+ });
93541
93548
  return ctx.services.session.end(gameIdOrSlug, sessionId, ctx.user.id);
93542
93549
  });
93543
93550
  mintToken = requireAuth(async (ctx) => {
@@ -93545,7 +93552,7 @@ var init_session_controller = __esm(() => {
93545
93552
  if (!gameIdOrSlug) {
93546
93553
  throw ApiError.badRequest("Missing game ID or slug");
93547
93554
  }
93548
- logger58.debug("Minting token", { userId: ctx.user.id, gameIdOrSlug });
93555
+ logger58.debug("Minting token", { userId: ctx.user.id, gameIdOrSlug, launchId: ctx.launchId });
93549
93556
  return ctx.services.session.mintToken(gameIdOrSlug, ctx.user.id);
93550
93557
  });
93551
93558
  sessions2 = {
@@ -93949,7 +93956,16 @@ var init_timeback_controller = __esm(() => {
93949
93956
  }
93950
93957
  throw ApiError.badRequest("Invalid JSON body");
93951
93958
  }
93952
- const { gameId, studentId, activityData, scoreData, timingData, xpEarned, masteredUnits } = body2;
93959
+ const {
93960
+ gameId,
93961
+ studentId,
93962
+ activityData,
93963
+ scoreData,
93964
+ timingData,
93965
+ xpEarned,
93966
+ masteredUnits,
93967
+ extensions
93968
+ } = body2;
93953
93969
  logger62.debug("Ending activity", { userId: ctx.user.id, gameId });
93954
93970
  return ctx.services.timeback.endActivity({
93955
93971
  gameId,
@@ -93959,6 +93975,7 @@ var init_timeback_controller = __esm(() => {
93959
93975
  timingData,
93960
93976
  xpEarned,
93961
93977
  masteredUnits,
93978
+ extensions,
93962
93979
  user: ctx.user
93963
93980
  });
93964
93981
  });
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.2",
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,6 @@
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",
61
59
  "@playcademy/timeback": "0.0.1",
62
60
  "@playcademy/types": "0.0.1",
63
61
  "@playcademy/utils": "0.0.1",