@playcademy/sandbox 0.3.2 → 0.3.5

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/config.d.ts CHANGED
@@ -14,6 +14,13 @@ interface TimebackOrganizationInput {
14
14
  name?: string;
15
15
  type?: TimebackOrgType;
16
16
  }
17
+ /**
18
+ * Course enrollment overrides.
19
+ * - `'mock'` or omit: Use mock ID
20
+ * - Real string: Use that course ID
21
+ * - `null` or `false`: Exclude from enrollment
22
+ */
23
+ type CourseEnrollmentOverrides = Record<string, 'mock' | string | null | false>;
17
24
  /**
18
25
  * Timeback configuration input for sandbox.
19
26
  * All fields optional since they can be derived from defaults.
@@ -29,6 +36,7 @@ interface TimebackConfig {
29
36
  timebackId?: string;
30
37
  organization?: TimebackOrganizationInput;
31
38
  role?: TimebackUserRole;
39
+ courseOverrides?: CourseEnrollmentOverrides;
32
40
  }
33
41
  /**
34
42
  * Authentication configuration input for sandbox.
@@ -76,4 +84,4 @@ declare function getTimebackDisplayMode(): 'mock' | 'remote' | 'local' | null;
76
84
  declare const config: SandboxConfig;
77
85
 
78
86
  export { config, configureTimeback, getTimebackDisplayMode, hasTimebackCredentials, hasTimebackFullConfig, isTimebackEnabled, requireTimebackCredentials, setEmbeddedMode };
79
- export type { AuthConfig, SandboxConfig, TimebackConfig, TimebackMode };
87
+ export type { AuthConfig, CourseEnrollmentOverrides, SandboxConfig, TimebackConfig, TimebackMode };
package/dist/config.js CHANGED
@@ -127,6 +127,9 @@ function configureTimeback(options) {
127
127
  config.timeback.role = options.role;
128
128
  process.env.SANDBOX_TIMEBACK_ROLE = options.role;
129
129
  }
130
+ if (options.courseOverrides) {
131
+ config.timeback.courseOverrides = options.courseOverrides;
132
+ }
130
133
  }
131
134
  function getTimebackDisplayMode() {
132
135
  const { timebackId, mode } = config.timeback;
@@ -17,6 +17,7 @@ export declare function shouldMockTimeback(): boolean;
17
17
  export declare function getMockStudentProfile(): TimebackStudentProfile;
18
18
  /**
19
19
  * Generate mock enrollments from seeded game integrations.
20
+ * Respects courseOverrides from config - null/false excludes the course.
20
21
  */
21
22
  export declare function getMockEnrollments(db: DatabaseInstance): Promise<UserEnrollment[]>;
22
23
  /**
package/dist/server.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import * as _playcademy_realtime_server_sandbox from '@playcademy/realtime/server/sandbox';
2
- import * as _playcademy_realtime_server from '@playcademy/realtime/server';
3
1
  import * as _hono_node_server from '@hono/node-server';
4
2
  import { TimebackOrgType, TimebackUserRole } from '@playcademy/data/types';
5
3
 
@@ -17,6 +15,13 @@ interface TimebackOrganizationInput {
17
15
  name?: string;
18
16
  type?: TimebackOrgType;
19
17
  }
18
+ /**
19
+ * Course enrollment overrides.
20
+ * - `'mock'` or omit: Use mock ID
21
+ * - Real string: Use that course ID
22
+ * - `null` or `false`: Exclude from enrollment
23
+ */
24
+ type CourseEnrollmentOverrides = Record<string, 'mock' | string | null | false>;
20
25
  /**
21
26
  * Timeback configuration input for sandbox.
22
27
  * All fields optional since they can be derived from defaults.
@@ -32,6 +37,7 @@ interface TimebackConfig {
32
37
  timebackId?: string;
33
38
  organization?: TimebackOrganizationInput;
34
39
  role?: TimebackUserRole;
40
+ courseOverrides?: CourseEnrollmentOverrides;
35
41
  }
36
42
 
37
43
  /**
@@ -234,36 +240,6 @@ interface ServerOptions {
234
240
  * ```
235
241
  */
236
242
  logLevel?: 'debug' | 'info' | 'warn' | 'error';
237
- /**
238
- * Realtime/WebSocket server configuration.
239
- *
240
- * The realtime server provides WebSocket support for live updates,
241
- * multiplayer features, and other real-time functionality.
242
- *
243
- * @example
244
- * ```ts
245
- * {
246
- * realtime: {
247
- * enabled: true,
248
- * port: 8789 // Run WebSocket server on port 8789
249
- * }
250
- * }
251
- * ```
252
- */
253
- realtime?: {
254
- /**
255
- * Enable the realtime/WebSocket server.
256
- * @default true
257
- */
258
- enabled?: boolean;
259
- /**
260
- * Port for the WebSocket server.
261
- *
262
- * By default, uses the HTTP port + 1 (e.g., if HTTP is 8788,
263
- * WebSocket will be 8789).
264
- */
265
- port?: number;
266
- };
267
243
  /**
268
244
  * Timeback (time travel) integration configuration.
269
245
  *
@@ -312,7 +288,6 @@ declare const version: string;
312
288
  */
313
289
  declare function startServer(port: number, project?: ProjectInfo, options?: Omit<ServerOptions, 'port' | 'project'>): Promise<{
314
290
  main: _hono_node_server.ServerType;
315
- realtime: Bun.Server<_playcademy_realtime_server.WebSocketData> | _playcademy_realtime_server_sandbox.SandboxRealtimeServer | null;
316
291
  timebackMode: "local" | "remote" | "mock" | null;
317
292
  setRole: (role: TimebackUserRole) => void;
318
293
  stop: () => Promise<void>;