playcademy 0.11.3 → 0.11.4
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/edge-play/src/constants.ts +6 -2
- package/dist/edge-play/src/entry.ts +1 -1
- package/dist/edge-play/src/index.ts +1 -0
- package/dist/edge-play/src/routes/index.ts +10 -4
- package/dist/index.js +3404 -2727
- package/dist/types.d.ts +61 -3
- package/dist/utils.js +131 -51
- package/package.json +1 -1
|
@@ -18,6 +18,10 @@ export const ROUTES = {
|
|
|
18
18
|
/** Route index (lists available routes) */
|
|
19
19
|
INDEX: '/api',
|
|
20
20
|
|
|
21
|
-
/** TimeBack integration routes
|
|
22
|
-
TIMEBACK:
|
|
21
|
+
/** TimeBack integration routes */
|
|
22
|
+
TIMEBACK: {
|
|
23
|
+
PROGRESS: `/api${TIMEBACK_ROUTES.PROGRESS}`,
|
|
24
|
+
SESSION_END: `/api${TIMEBACK_ROUTES.SESSION_END}`,
|
|
25
|
+
AWARD_XP: `/api${TIMEBACK_ROUTES.AWARD_XP}`,
|
|
26
|
+
},
|
|
23
27
|
} as const
|
|
@@ -103,6 +103,6 @@ app.use('*', async (c, next) => {
|
|
|
103
103
|
* Uses dynamic imports for tree-shaking: if an integration is not enabled,
|
|
104
104
|
* its route code is completely removed from the bundle.
|
|
105
105
|
*/
|
|
106
|
-
registerBuiltinRoutes(app, PLAYCADEMY_CONFIG.integrations)
|
|
106
|
+
await registerBuiltinRoutes(app, PLAYCADEMY_CONFIG.integrations)
|
|
107
107
|
|
|
108
108
|
export default app
|
|
@@ -2,21 +2,27 @@
|
|
|
2
2
|
* Route discovery endpoint
|
|
3
3
|
* Route: GET /api
|
|
4
4
|
* Always included - lists all available routes
|
|
5
|
+
*
|
|
6
|
+
* NOTE: This pulls from the actual ROUTES constants used for registration,
|
|
7
|
+
* ensuring the advertised routes match what's actually deployed.
|
|
5
8
|
*/
|
|
6
9
|
|
|
10
|
+
import { ROUTES } from '../constants'
|
|
11
|
+
|
|
7
12
|
import type { Context } from 'hono'
|
|
8
13
|
import type { HonoEnv } from '../types'
|
|
9
14
|
|
|
10
15
|
export async function GET(c: Context<HonoEnv>): Promise<Response> {
|
|
11
16
|
const config = c.get('config')
|
|
12
17
|
const customRoutes = c.get('customRoutes') || []
|
|
13
|
-
const routes: string[] = [
|
|
18
|
+
const routes: string[] = [`GET ${ROUTES.INDEX}`, `GET ${ROUTES.HEALTH}`]
|
|
14
19
|
|
|
20
|
+
// Add TimeBack routes if configured
|
|
15
21
|
if (config.integrations?.timeback) {
|
|
16
22
|
routes.push(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
`POST ${ROUTES.TIMEBACK.PROGRESS}`,
|
|
24
|
+
`POST ${ROUTES.TIMEBACK.SESSION_END}`,
|
|
25
|
+
`POST ${ROUTES.TIMEBACK.AWARD_XP}`,
|
|
20
26
|
)
|
|
21
27
|
}
|
|
22
28
|
|