playcademy 0.14.13 → 0.14.14-alpha.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.
- package/dist/constants/src/academics.ts +28 -0
- package/dist/constants/src/domains.ts +22 -5
- package/dist/constants/src/index.ts +1 -0
- package/dist/constants.d.ts +54 -20
- package/dist/constants.js +59 -19
- package/dist/db.js +68 -18
- package/dist/edge-play/src/entry/middleware.ts +60 -0
- package/dist/edge-play/src/entry/session.ts +34 -0
- package/dist/edge-play/src/entry.ts +6 -0
- package/dist/index.d.ts +220 -128
- package/dist/index.js +1198 -461
- package/dist/templates/api/sample-database.ts.template +18 -39
- package/dist/templates/api/sample-kv.ts.template +53 -46
- package/dist/templates/auth/auth.ts.template +1 -1
- package/dist/templates/config/timeback-config.js.template +2 -2
- package/dist/templates/database/db-schema-example.ts.template +29 -0
- package/dist/templates/database/db-schema-index.ts.template +1 -2
- package/dist/templates/database/db-seed.ts.template +12 -20
- package/dist/templates/database/db-types.ts.template +2 -10
- package/dist/templates/database/drizzle-config.ts.template +2 -2
- package/dist/utils.d.ts +9 -2
- package/dist/utils.js +211 -71
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/templates/database/db-schema-scores.ts.template +0 -43
- package/dist/templates/database/db-schema-users.ts.template +0 -23
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Scores Schema
|
|
3
|
-
*
|
|
4
|
-
* Define game score tables here using Drizzle ORM.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { relations } from 'drizzle-orm'
|
|
8
|
-
import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core'
|
|
9
|
-
|
|
10
|
-
import { users } from './users'
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Scores table
|
|
14
|
-
*
|
|
15
|
-
* Tracks game scores per user with level information
|
|
16
|
-
*/
|
|
17
|
-
export const scores = sqliteTable('scores', {
|
|
18
|
-
/** Unique score ID */
|
|
19
|
-
id: integer('id').primaryKey({ autoIncrement: true }),
|
|
20
|
-
/** Reference to user who earned this score */
|
|
21
|
-
userId: integer('user_id')
|
|
22
|
-
.notNull()
|
|
23
|
-
.references(() => users.id),
|
|
24
|
-
/** Score value (points earned) */
|
|
25
|
-
score: integer('score').notNull(),
|
|
26
|
-
/** Level where score was earned */
|
|
27
|
-
level: integer('level').notNull(),
|
|
28
|
-
/** Timestamp when score was created */
|
|
29
|
-
createdAt: text('created_at').notNull(),
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Score relations
|
|
34
|
-
*
|
|
35
|
-
* Defines how scores relate to users (many-to-one)
|
|
36
|
-
*/
|
|
37
|
-
export const scoresRelations = relations(scores, ({ one }) => ({
|
|
38
|
-
user: one(users, {
|
|
39
|
-
fields: [scores.userId],
|
|
40
|
-
references: [users.id],
|
|
41
|
-
}),
|
|
42
|
-
}))
|
|
43
|
-
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Users Schema
|
|
3
|
-
*
|
|
4
|
-
* Define user-related tables here using Drizzle ORM.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Users table
|
|
11
|
-
*
|
|
12
|
-
* Stores basic user information
|
|
13
|
-
*/
|
|
14
|
-
export const users = sqliteTable('users', {
|
|
15
|
-
/** Unique user ID */
|
|
16
|
-
id: integer('id').primaryKey({ autoIncrement: true }),
|
|
17
|
-
/** User's display name */
|
|
18
|
-
name: text('name').notNull(),
|
|
19
|
-
/** Timestamp when user was created */
|
|
20
|
-
createdAt: text('created_at').notNull(),
|
|
21
|
-
/** Timestamp when user was last updated */
|
|
22
|
-
updatedAt: text('updated_at').notNull(),
|
|
23
|
-
})
|