playcademy 0.15.5 → 0.15.6

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.
package/dist/cli.js CHANGED
@@ -2965,7 +2965,7 @@ import { join as join13 } from "path";
2965
2965
  // package.json with { type: 'json' }
2966
2966
  var package_default2 = {
2967
2967
  name: "playcademy",
2968
- version: "0.15.4",
2968
+ version: "0.15.5",
2969
2969
  type: "module",
2970
2970
  exports: {
2971
2971
  ".": {
@@ -20,6 +20,19 @@ import type { HonoEnv } from '../../../types'
20
20
  /** Valid grade levels: -1 (Pre-K), 0 (Kindergarten), 1-12 (Grades), 13 (AP) */
21
21
  const VALID_GRADES = [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] as const
22
22
 
23
+ /** Valid TimeBack subject values */
24
+ const VALID_SUBJECTS = [
25
+ 'Reading',
26
+ 'Language',
27
+ 'Vocabulary',
28
+ 'Social Studies',
29
+ 'Writing',
30
+ 'Science',
31
+ 'FastMath',
32
+ 'Math',
33
+ 'None',
34
+ ] as const
35
+
23
36
  function isValidGrade(value: unknown): value is (typeof VALID_GRADES)[number] {
24
37
  return (
25
38
  typeof value === 'number' &&
@@ -28,6 +41,13 @@ function isValidGrade(value: unknown): value is (typeof VALID_GRADES)[number] {
28
41
  )
29
42
  }
30
43
 
44
+ function isValidSubject(value: unknown): value is (typeof VALID_SUBJECTS)[number] {
45
+ return (
46
+ typeof value === 'string' &&
47
+ VALID_SUBJECTS.includes(value as (typeof VALID_SUBJECTS)[number])
48
+ )
49
+ }
50
+
31
51
  function getConfig(c: Context<HonoEnv>): PlaycademyConfig {
32
52
  const config = c.get('config')
33
53
  const timebackConfig = config?.integrations?.timeback
@@ -47,8 +67,8 @@ function validateRequestBody(body: {
47
67
  if (!isValidGrade(body.activityData?.grade)) {
48
68
  return { error: `grade must be a valid grade level (${VALID_GRADES.join(', ')})` }
49
69
  }
50
- if (!body.activityData?.subject) {
51
- return { error: 'subject is required' }
70
+ if (!isValidSubject(body.activityData?.subject)) {
71
+ return { error: `subject must be a valid subject (${VALID_SUBJECTS.join(', ')})` }
52
72
  }
53
73
  if (
54
74
  typeof body.scoreData?.correctQuestions !== 'number' ||
package/dist/index.js CHANGED
@@ -3976,7 +3976,7 @@ import { join as join12 } from "path";
3976
3976
  // package.json with { type: 'json' }
3977
3977
  var package_default2 = {
3978
3978
  name: "playcademy",
3979
- version: "0.15.4",
3979
+ version: "0.15.5",
3980
3980
  type: "module",
3981
3981
  exports: {
3982
3982
  ".": {
@@ -10625,7 +10625,7 @@ var getStatusCommand = new Command13("status").description("Check your developer
10625
10625
  });
10626
10626
 
10627
10627
  // package.json
10628
- var version2 = "0.15.4";
10628
+ var version2 = "0.15.5";
10629
10629
 
10630
10630
  // src/commands/dev/server.ts
10631
10631
  function setupCleanupHandlers(workspace, getServer) {
package/dist/utils.js CHANGED
@@ -2321,7 +2321,7 @@ import { join as join12 } from "path";
2321
2321
  // package.json with { type: 'json' }
2322
2322
  var package_default2 = {
2323
2323
  name: "playcademy",
2324
- version: "0.15.4",
2324
+ version: "0.15.5",
2325
2325
  type: "module",
2326
2326
  exports: {
2327
2327
  ".": {
package/dist/version.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // package.json with { type: 'json' }
2
2
  var package_default = {
3
3
  name: "playcademy",
4
- version: "0.15.4",
4
+ version: "0.15.5",
5
5
  type: "module",
6
6
  exports: {
7
7
  ".": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "playcademy",
3
- "version": "0.15.5",
3
+ "version": "0.15.6",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@inquirer/prompts": "^7.8.6",
53
- "@playcademy/sdk": "0.2.5",
53
+ "@playcademy/sdk": "0.2.6",
54
54
  "chokidar": "^4.0.3",
55
55
  "colorette": "^2.0.20",
56
56
  "commander": "^14.0.1",