@playcademy/sdk 0.2.1 → 0.2.3
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/README.md +20 -17
- package/dist/index.d.ts +486 -480
- package/dist/index.js +1455 -1399
- package/dist/internal.d.ts +4515 -3537
- package/dist/internal.js +2612 -2603
- package/dist/server.d.ts +304 -44
- package/dist/server.js +118 -9
- package/dist/types.d.ts +2779 -996
- package/package.json +5 -3
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as _playcademy_timeback_types from '@playcademy/timeback/types';
|
|
3
|
-
import { CourseConfig, OrganizationConfig, ComponentConfig, ResourceConfig, ComponentResourceConfig } from '@playcademy/timeback/types';
|
|
1
|
+
import { InferSelectModel } from 'drizzle-orm';
|
|
4
2
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
3
|
+
import * as drizzle_zod from 'drizzle-zod';
|
|
5
4
|
import { z } from 'zod';
|
|
6
5
|
import { AUTH_PROVIDER_IDS } from '@playcademy/constants';
|
|
7
6
|
|
|
@@ -20,31 +19,1153 @@ declare function parseOAuthState(state: string): {
|
|
|
20
19
|
data?: Record<string, string>;
|
|
21
20
|
};
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Game Types
|
|
24
|
+
*
|
|
25
|
+
* Literal types and API DTOs. Database row types are in @playcademy/data/types.
|
|
26
|
+
*
|
|
27
|
+
* @module types/game
|
|
28
|
+
*/
|
|
29
|
+
type GameType = 'hosted' | 'external';
|
|
30
|
+
type GamePlatform = 'web' | 'godot' | 'unity' | (string & {});
|
|
31
|
+
/**
|
|
32
|
+
* Game manifest file format (manifest.json).
|
|
33
|
+
* Note: createdAt is a string here because it's parsed from JSON file.
|
|
34
|
+
*/
|
|
35
|
+
interface ManifestV1 {
|
|
36
|
+
version: string;
|
|
37
|
+
platform: string;
|
|
38
|
+
createdAt: string;
|
|
39
|
+
}
|
|
40
|
+
interface DomainValidationRecords {
|
|
41
|
+
ownership?: {
|
|
42
|
+
name?: string;
|
|
43
|
+
value?: string;
|
|
44
|
+
type?: string;
|
|
45
|
+
};
|
|
46
|
+
ssl?: Array<{
|
|
47
|
+
txt_name?: string;
|
|
48
|
+
txt_value?: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Permitted HTTP verbs */
|
|
53
|
+
type Method = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* User Types
|
|
57
|
+
*
|
|
58
|
+
* Enums, DTOs and API response types. Database row types are in @playcademy/data/types.
|
|
59
|
+
*
|
|
60
|
+
* @module types/user
|
|
61
|
+
*/
|
|
62
|
+
type UserRoleEnumType = 'admin' | 'player' | 'developer';
|
|
63
|
+
type DeveloperStatusEnumType = 'none' | 'pending' | 'approved';
|
|
64
|
+
type DeveloperStatusValue = DeveloperStatusEnumType;
|
|
65
|
+
type TimebackUserRole = 'administrator' | 'aide' | 'guardian' | 'parent' | 'proctor' | 'relative' | 'student' | 'teacher';
|
|
66
|
+
type TimebackOrgType = 'department' | 'school' | 'district' | 'local' | 'state' | 'national';
|
|
67
|
+
interface UserEnrollment {
|
|
68
|
+
gameId?: string;
|
|
69
|
+
courseId: string;
|
|
70
|
+
grade: number;
|
|
71
|
+
subject: string;
|
|
72
|
+
orgId?: string;
|
|
73
|
+
}
|
|
74
|
+
interface UserOrganization {
|
|
75
|
+
id: string;
|
|
76
|
+
name: string | null;
|
|
77
|
+
type: TimebackOrgType | string;
|
|
78
|
+
isPrimary: boolean;
|
|
79
|
+
}
|
|
80
|
+
interface TimebackStudentProfile {
|
|
81
|
+
role: TimebackUserRole;
|
|
82
|
+
organizations: UserOrganization[];
|
|
83
|
+
}
|
|
84
|
+
interface UserTimebackData extends TimebackStudentProfile {
|
|
85
|
+
id: string;
|
|
86
|
+
enrollments: UserEnrollment[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* OpenID Connect UserInfo claims (NOT a database row).
|
|
90
|
+
*/
|
|
91
|
+
interface UserInfo {
|
|
92
|
+
sub: string;
|
|
93
|
+
email: string;
|
|
94
|
+
name: string | null;
|
|
95
|
+
email_verified?: boolean;
|
|
96
|
+
given_name?: string;
|
|
97
|
+
family_name?: string;
|
|
98
|
+
issuer?: string;
|
|
99
|
+
lti_roles?: unknown;
|
|
100
|
+
lti_context?: unknown;
|
|
101
|
+
lti_resource_link?: unknown;
|
|
102
|
+
timeback_id?: string;
|
|
103
|
+
}
|
|
104
|
+
interface DeveloperStatusResponse {
|
|
105
|
+
status: DeveloperStatusEnumType;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Authenticated user for API responses.
|
|
109
|
+
* Differs from UserRow: omits timebackId, adds hasTimebackAccount and timeback.
|
|
110
|
+
*/
|
|
111
|
+
interface AuthenticatedUser {
|
|
112
|
+
id: string;
|
|
113
|
+
email: string;
|
|
114
|
+
emailVerified: boolean;
|
|
115
|
+
name: string | null;
|
|
116
|
+
image: string | null;
|
|
117
|
+
username: string | null;
|
|
118
|
+
role: UserRoleEnumType;
|
|
119
|
+
developerStatus: DeveloperStatusEnumType;
|
|
120
|
+
characterCreated: boolean;
|
|
121
|
+
createdAt: Date;
|
|
122
|
+
updatedAt: Date;
|
|
123
|
+
hasTimebackAccount: boolean;
|
|
124
|
+
timeback?: UserTimebackData;
|
|
125
|
+
}
|
|
126
|
+
interface GameUser {
|
|
127
|
+
id: string;
|
|
128
|
+
name: string | null;
|
|
129
|
+
role: UserRoleEnumType;
|
|
130
|
+
username: string | null;
|
|
131
|
+
email: string | null;
|
|
132
|
+
timeback?: UserTimebackData;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Leaderboard Types
|
|
137
|
+
*
|
|
138
|
+
* @module types/leaderboard
|
|
139
|
+
*/
|
|
140
|
+
type LeaderboardTimeframe = 'all_time' | 'monthly' | 'weekly' | 'daily';
|
|
141
|
+
interface LeaderboardOptions {
|
|
142
|
+
timeframe?: LeaderboardTimeframe;
|
|
143
|
+
limit?: number;
|
|
144
|
+
offset?: number;
|
|
145
|
+
gameId?: string;
|
|
146
|
+
}
|
|
147
|
+
interface LeaderboardEntry {
|
|
148
|
+
rank: number;
|
|
149
|
+
userId: string;
|
|
150
|
+
username: string;
|
|
151
|
+
userImage?: string | null;
|
|
152
|
+
score: number;
|
|
153
|
+
achievedAt: Date;
|
|
154
|
+
metadata?: Record<string, unknown>;
|
|
155
|
+
gameId?: string;
|
|
156
|
+
gameTitle?: string;
|
|
157
|
+
gameSlug?: string;
|
|
158
|
+
}
|
|
159
|
+
interface UserRank {
|
|
160
|
+
rank: number;
|
|
161
|
+
totalPlayers: number;
|
|
162
|
+
score: number;
|
|
163
|
+
percentile: number;
|
|
164
|
+
}
|
|
165
|
+
interface UserRankResponse {
|
|
166
|
+
rank: number;
|
|
167
|
+
score: number;
|
|
168
|
+
userId: string;
|
|
169
|
+
}
|
|
170
|
+
interface UserScore {
|
|
171
|
+
id: string;
|
|
172
|
+
score: number;
|
|
173
|
+
achievedAt: Date;
|
|
174
|
+
metadata?: Record<string, unknown>;
|
|
175
|
+
gameId: string;
|
|
176
|
+
gameTitle: string;
|
|
177
|
+
gameSlug: string;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Leaderboard entry with required game context.
|
|
181
|
+
* Used when fetching leaderboards for a specific game.
|
|
182
|
+
*/
|
|
183
|
+
interface GameLeaderboardEntry {
|
|
184
|
+
rank: number;
|
|
185
|
+
userId: string;
|
|
186
|
+
username: string;
|
|
187
|
+
userImage?: string | null;
|
|
188
|
+
score: number;
|
|
189
|
+
achievedAt: Date;
|
|
190
|
+
metadata?: Record<string, unknown>;
|
|
191
|
+
gameId: string;
|
|
192
|
+
gameTitle: string;
|
|
193
|
+
gameSlug: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Achievement Types
|
|
198
|
+
*
|
|
199
|
+
* @module types/achievement
|
|
200
|
+
*/
|
|
201
|
+
type AchievementScopeType = 'daily' | 'weekly' | 'monthly' | 'yearly' | 'game' | 'global' | 'map' | 'level' | 'event';
|
|
202
|
+
declare enum AchievementCompletionType {
|
|
203
|
+
TIME_PLAYED_SESSION = "time_played_session",
|
|
204
|
+
INTERACTION = "interaction",
|
|
205
|
+
LEADERBOARD_RANK = "leaderboard_rank",
|
|
206
|
+
FIRST_SCORE = "first_score",
|
|
207
|
+
PERSONAL_BEST = "personal_best"
|
|
208
|
+
}
|
|
209
|
+
interface AchievementCurrent {
|
|
210
|
+
id: string;
|
|
211
|
+
title: string;
|
|
212
|
+
description?: string | null;
|
|
213
|
+
scope: AchievementScopeType;
|
|
214
|
+
rewardCredits: number;
|
|
215
|
+
limit: number;
|
|
216
|
+
completionType: string;
|
|
217
|
+
completionConfig: unknown;
|
|
218
|
+
target: unknown;
|
|
219
|
+
active: boolean;
|
|
220
|
+
createdAt?: Date | null;
|
|
221
|
+
updatedAt?: Date | null;
|
|
222
|
+
status: 'available' | 'completed';
|
|
223
|
+
scopeKey: string;
|
|
224
|
+
windowStart: string;
|
|
225
|
+
windowEnd: string;
|
|
226
|
+
}
|
|
227
|
+
interface AchievementWithStatus {
|
|
228
|
+
id: string;
|
|
229
|
+
title: string;
|
|
230
|
+
description: string | null;
|
|
231
|
+
scope: AchievementScopeType;
|
|
232
|
+
rewardCredits: number;
|
|
233
|
+
limit: number;
|
|
234
|
+
completionType: string;
|
|
235
|
+
completionConfig: unknown;
|
|
236
|
+
target: unknown;
|
|
237
|
+
active: boolean;
|
|
238
|
+
createdAt: Date | null;
|
|
239
|
+
updatedAt: Date | null;
|
|
240
|
+
status: 'available' | 'completed';
|
|
241
|
+
scopeKey: string;
|
|
242
|
+
windowStart?: string;
|
|
243
|
+
windowEnd?: string;
|
|
244
|
+
}
|
|
245
|
+
interface AchievementHistoryEntry {
|
|
246
|
+
achievementId: string;
|
|
247
|
+
title: string;
|
|
248
|
+
rewardCredits: number;
|
|
249
|
+
createdAt: Date;
|
|
250
|
+
scopeKey: string;
|
|
251
|
+
}
|
|
252
|
+
interface AchievementProgressResponse {
|
|
253
|
+
achievementId: string;
|
|
254
|
+
status: 'completed' | 'already_completed';
|
|
255
|
+
rewardCredits: number;
|
|
256
|
+
scopeKey: string;
|
|
257
|
+
createdAt: Date;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* TimeBack Enums & Literal Types
|
|
262
|
+
*
|
|
263
|
+
* Basic type definitions used throughout the TimeBack integration.
|
|
264
|
+
*
|
|
265
|
+
* @module types/timeback/types
|
|
266
|
+
*/
|
|
267
|
+
/**
|
|
268
|
+
* Valid TimeBack subject values for course configuration.
|
|
269
|
+
* These are the supported subject values for OneRoster courses.
|
|
270
|
+
*/
|
|
271
|
+
type TimebackSubject = 'Reading' | 'Language' | 'Vocabulary' | 'Social Studies' | 'Writing' | 'Science' | 'FastMath' | 'Math' | 'None';
|
|
272
|
+
/**
|
|
273
|
+
* Grade levels per AE OneRoster GradeEnum.
|
|
274
|
+
* -1 = Pre-K, 0 = Kindergarten, 1-12 = Grades 1-12, 13 = AP
|
|
275
|
+
*/
|
|
276
|
+
type TimebackGrade = -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
|
|
277
|
+
/**
|
|
278
|
+
* Valid Caliper subject values.
|
|
279
|
+
* Matches OneRoster subjects, with "None" as a Caliper-specific fallback.
|
|
280
|
+
*/
|
|
281
|
+
type CaliperSubject = 'Reading' | 'Language' | 'Vocabulary' | 'Social Studies' | 'Writing' | 'Science' | 'FastMath' | 'Math' | 'None';
|
|
282
|
+
/**
|
|
283
|
+
* OneRoster organization types.
|
|
284
|
+
*/
|
|
285
|
+
type OrganizationType = 'department' | 'school' | 'district' | 'local' | 'state' | 'national';
|
|
286
|
+
/**
|
|
287
|
+
* Lesson types for PowerPath integration.
|
|
288
|
+
*/
|
|
289
|
+
type LessonType = 'powerpath-100' | 'quiz' | 'test-out' | 'placement' | 'unit-test' | 'alpha-read-article' | null;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* TimeBack Configuration Types
|
|
293
|
+
*
|
|
294
|
+
* Configuration interfaces for Organization, Course, Component,
|
|
295
|
+
* Resource, and complete TimeBack setup.
|
|
296
|
+
*
|
|
297
|
+
* @module types/timeback/config
|
|
298
|
+
*/
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* Organization configuration for TimeBack (user input - optionals allowed)
|
|
302
|
+
*/
|
|
303
|
+
interface OrganizationConfig {
|
|
304
|
+
/** Display name for your organization */
|
|
305
|
+
name?: string;
|
|
306
|
+
/** Organization type */
|
|
307
|
+
type?: OrganizationType;
|
|
308
|
+
/** Unique identifier (defaults to Playcademy's org) */
|
|
309
|
+
identifier?: string;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Course goals for daily student targets
|
|
313
|
+
*/
|
|
314
|
+
interface CourseGoals {
|
|
315
|
+
/** Target XP students should earn per day */
|
|
316
|
+
dailyXp?: number;
|
|
317
|
+
/** Target lessons per day */
|
|
318
|
+
dailyLessons?: number;
|
|
319
|
+
/** Target active minutes per day */
|
|
320
|
+
dailyActiveMinutes?: number;
|
|
321
|
+
/** Target accuracy percentage */
|
|
322
|
+
dailyAccuracy?: number;
|
|
323
|
+
/** Target mastered units per day */
|
|
324
|
+
dailyMasteredUnits?: number;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Course metrics and totals
|
|
328
|
+
*/
|
|
329
|
+
interface CourseMetrics {
|
|
330
|
+
/** Total XP available in the course */
|
|
331
|
+
totalXp?: number;
|
|
332
|
+
/** Total lessons/activities in the course */
|
|
333
|
+
totalLessons?: number;
|
|
334
|
+
/** Total number of grade levels covered by this course */
|
|
335
|
+
totalGrades?: number;
|
|
336
|
+
/** The type of course (e.g. 'optional', 'hole-filling', 'base') */
|
|
337
|
+
courseType?: 'base' | 'hole-filling' | 'optional' | 'Base' | 'Hole-Filling' | 'Optional';
|
|
338
|
+
/** Indicates whether the course is supplemental content */
|
|
339
|
+
isSupplemental?: boolean;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Complete course metadata structure
|
|
343
|
+
*/
|
|
344
|
+
interface CourseMetadata {
|
|
345
|
+
/** Define the type of course and priority for the student */
|
|
346
|
+
courseType?: 'base' | 'hole-filling' | 'optional';
|
|
347
|
+
/** Boolean value to determine if a course is supplemental to a base course */
|
|
348
|
+
isSupplemental?: boolean;
|
|
349
|
+
/** Boolean value to determine if a course is custom to an individual student */
|
|
350
|
+
isCustom?: boolean;
|
|
351
|
+
/** Signals whether a course is in production with students */
|
|
352
|
+
publishStatus?: 'draft' | 'testing' | 'published' | 'deactivated';
|
|
353
|
+
/** Who to contact when issues reported with questions */
|
|
354
|
+
contactEmail?: string;
|
|
355
|
+
/** Primary app identifier */
|
|
356
|
+
primaryApp?: string;
|
|
357
|
+
/** Learning goals for students */
|
|
358
|
+
goals?: CourseGoals;
|
|
359
|
+
/** Course metrics and totals */
|
|
360
|
+
metrics?: CourseMetrics;
|
|
361
|
+
/** Vendor-specific metadata (e.g., AlphaLearn) */
|
|
362
|
+
[key: string]: unknown;
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Course configuration for TimeBack (user input)
|
|
366
|
+
*/
|
|
367
|
+
interface CourseConfig {
|
|
368
|
+
/** Allocated OneRoster sourcedId (set after creation) */
|
|
369
|
+
sourcedId?: string;
|
|
370
|
+
/** Course title (defaults to game name) */
|
|
371
|
+
title?: string;
|
|
372
|
+
/** Subjects (REQUIRED for TimeBack integration) */
|
|
373
|
+
subjects: TimebackSubject[];
|
|
374
|
+
/** Used when recording progress/sessions if not explicitly specified per event. */
|
|
375
|
+
defaultSubject?: TimebackSubject;
|
|
376
|
+
/** Grade levels (REQUIRED for TimeBack integration) */
|
|
377
|
+
grades: TimebackGrade[];
|
|
378
|
+
/** Short course code (optional, auto-generated) */
|
|
379
|
+
courseCode?: string;
|
|
380
|
+
/** Course level (auto-derived from grades) */
|
|
381
|
+
level?: 'Elementary' | 'Middle' | 'High' | 'AP' | string;
|
|
382
|
+
/** Grading system */
|
|
383
|
+
gradingScheme?: 'STANDARD';
|
|
384
|
+
/** Total XP available in this course (REQUIRED before setup) */
|
|
385
|
+
totalXp?: number | null;
|
|
386
|
+
/** Total masterable units in this course (REQUIRED before setup) */
|
|
387
|
+
masterableUnits?: number | null;
|
|
388
|
+
/** Custom Playcademy metadata */
|
|
389
|
+
metadata?: CourseMetadata;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Component configuration for TimeBack (user input)
|
|
393
|
+
*/
|
|
394
|
+
interface ComponentConfig {
|
|
395
|
+
/** Component title (defaults to "{course.title} Activities") */
|
|
396
|
+
title?: string;
|
|
397
|
+
/** Display order */
|
|
398
|
+
sortOrder?: number;
|
|
399
|
+
/** Required prior components */
|
|
400
|
+
prerequisites?: string[];
|
|
401
|
+
/** How prerequisites work */
|
|
402
|
+
prerequisiteCriteria?: 'ALL' | 'ANY';
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Playcademy-specific resource extensions
|
|
406
|
+
*/
|
|
407
|
+
interface PlaycademyResourceMetadata {
|
|
408
|
+
/** Mastery configuration for tracking discrete learning units */
|
|
409
|
+
mastery?: {
|
|
410
|
+
/** Total number of masterable units in the resource */
|
|
411
|
+
masterableUnits: number;
|
|
412
|
+
/** Type of mastery unit for semantic clarity */
|
|
413
|
+
unitType?: 'level' | 'rank' | 'skill' | 'module';
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Resource configuration for TimeBack (user input)
|
|
418
|
+
*/
|
|
419
|
+
interface ResourceConfig {
|
|
420
|
+
/** Resource title (defaults to "{course.title} Game") */
|
|
421
|
+
title?: string;
|
|
422
|
+
/** Internal resource ID (auto-generated from package.json) */
|
|
423
|
+
vendorResourceId?: string;
|
|
424
|
+
/** Vendor identifier */
|
|
425
|
+
vendorId?: string;
|
|
426
|
+
/** Application identifier */
|
|
427
|
+
applicationId?: string;
|
|
428
|
+
/** Resource roles */
|
|
429
|
+
roles?: ('primary' | 'secondary')[];
|
|
430
|
+
/** Resource importance */
|
|
431
|
+
importance?: 'primary' | 'secondary';
|
|
432
|
+
/** Interactive resource metadata */
|
|
433
|
+
metadata?: {
|
|
434
|
+
/** Resource type */
|
|
435
|
+
type?: 'interactive';
|
|
436
|
+
/** Launch URL (defaults to Playcademy game URL) */
|
|
437
|
+
launchUrl?: string;
|
|
438
|
+
/** Platform name */
|
|
439
|
+
toolProvider?: string;
|
|
440
|
+
/** Teaching method */
|
|
441
|
+
instructionalMethod?: 'exploratory' | 'direct-instruction';
|
|
442
|
+
/** Subject area */
|
|
443
|
+
subject?: TimebackSubject;
|
|
444
|
+
/** Target grades */
|
|
445
|
+
grades?: TimebackGrade[];
|
|
446
|
+
/** Content language */
|
|
447
|
+
language?: string;
|
|
448
|
+
/** Base XP for completion */
|
|
449
|
+
xp?: number;
|
|
450
|
+
/** Playcademy-specific extensions */
|
|
451
|
+
playcademy?: PlaycademyResourceMetadata;
|
|
452
|
+
};
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Component Resource link configuration (user input)
|
|
456
|
+
*/
|
|
457
|
+
interface ComponentResourceConfig {
|
|
458
|
+
/** Link title (defaults to "{resource.title} Activity") */
|
|
459
|
+
title?: string;
|
|
460
|
+
/** Display order */
|
|
461
|
+
sortOrder?: number;
|
|
462
|
+
/** Lesson type for PowerPath integration */
|
|
463
|
+
lessonType?: LessonType;
|
|
464
|
+
}
|
|
465
|
+
interface TimebackCourseConfig {
|
|
466
|
+
subject: string;
|
|
467
|
+
grade: number;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* TimeBack Client SDK DTOs
|
|
472
|
+
*
|
|
473
|
+
* Data transfer objects for the TimeBack client SDK including
|
|
474
|
+
* progress tracking, session management, and activity completion.
|
|
475
|
+
*
|
|
476
|
+
* Note: TimebackClientConfig lives in @playcademy/timeback as it's
|
|
477
|
+
* SDK configuration, not a DTO.
|
|
478
|
+
*
|
|
479
|
+
* @module types/timeback/client
|
|
480
|
+
*/
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Activity data for ending an activity
|
|
484
|
+
*/
|
|
485
|
+
interface ActivityData {
|
|
486
|
+
/** Unique activity identifier (required) */
|
|
487
|
+
activityId: string;
|
|
488
|
+
/** Grade level for this activity (required for multi-grade course routing) */
|
|
489
|
+
grade: number;
|
|
490
|
+
/** Subject area (required for multi-grade course routing) */
|
|
491
|
+
subject: CaliperSubject;
|
|
492
|
+
/** Activity display name (optional) */
|
|
493
|
+
activityName?: string;
|
|
494
|
+
/** Course identifier (auto-filled from config if not provided) */
|
|
495
|
+
courseId?: string;
|
|
496
|
+
/** Course display name (auto-filled from config if not provided) */
|
|
497
|
+
courseName?: string;
|
|
498
|
+
/** Student email address (optional) */
|
|
499
|
+
studentEmail?: string;
|
|
500
|
+
/** Application name for Caliper events (defaults to 'Game') */
|
|
501
|
+
appName?: string;
|
|
502
|
+
/** Sensor URL for Caliper events (defaults to baseUrl) */
|
|
503
|
+
sensorUrl?: string;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* Score data with optional XP override for ending an activity
|
|
507
|
+
*/
|
|
508
|
+
interface EndActivityScoreData {
|
|
509
|
+
/** Number of questions answered correctly */
|
|
510
|
+
correctQuestions: number;
|
|
511
|
+
/** Total number of questions */
|
|
512
|
+
totalQuestions: number;
|
|
513
|
+
/** Optional XP override - bypasses automatic XP calculation */
|
|
514
|
+
xpAwarded?: number;
|
|
515
|
+
/** Number of learning units mastered */
|
|
516
|
+
masteredUnits?: number;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* TimeBack API Request/Response Types
|
|
521
|
+
*
|
|
522
|
+
* Types for TimeBack API endpoints including XP tracking,
|
|
523
|
+
* setup, verification, and activity completion.
|
|
524
|
+
*
|
|
525
|
+
* @module types/timeback/api
|
|
526
|
+
*/
|
|
527
|
+
|
|
528
|
+
interface TodayXpResponse {
|
|
529
|
+
xp: number;
|
|
530
|
+
date: string;
|
|
531
|
+
}
|
|
532
|
+
interface TotalXpResponse {
|
|
533
|
+
totalXp: number;
|
|
534
|
+
}
|
|
535
|
+
interface XpHistoryResponse {
|
|
536
|
+
history: Array<{
|
|
537
|
+
date: string;
|
|
538
|
+
xp: number;
|
|
539
|
+
}>;
|
|
540
|
+
}
|
|
541
|
+
interface PopulateStudentResponse {
|
|
542
|
+
status: string;
|
|
543
|
+
message?: string;
|
|
544
|
+
}
|
|
545
|
+
interface GameTimebackIntegration {
|
|
546
|
+
id: string;
|
|
547
|
+
gameId: string;
|
|
548
|
+
courseId: string;
|
|
549
|
+
grade: number;
|
|
550
|
+
subject: string;
|
|
551
|
+
totalXp?: number | null;
|
|
552
|
+
lastVerifiedAt?: Date | null;
|
|
553
|
+
createdAt: Date;
|
|
554
|
+
updatedAt: Date;
|
|
555
|
+
}
|
|
556
|
+
interface EndActivityResponse {
|
|
557
|
+
status: 'ok';
|
|
558
|
+
courseId: string;
|
|
559
|
+
xpAwarded: number;
|
|
560
|
+
masteredUnits?: number;
|
|
561
|
+
pctCompleteApp?: number;
|
|
562
|
+
scoreStatus?: string;
|
|
563
|
+
inProgress?: string;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Inventory & Shop Types
|
|
568
|
+
*
|
|
569
|
+
* Literal types for inventory system. Database row types are in @playcademy/data/types.
|
|
570
|
+
*
|
|
571
|
+
* @module types/inventory
|
|
572
|
+
*/
|
|
573
|
+
/**
|
|
574
|
+
* Item categories available on the platform.
|
|
575
|
+
*/
|
|
576
|
+
type ItemType = 'currency' | 'badge' | 'trophy' | 'collectible' | 'consumable' | 'unlock' | 'upgrade' | 'accessory' | 'other';
|
|
577
|
+
|
|
578
|
+
/**
|
|
579
|
+
* Map & Placement Types
|
|
580
|
+
*
|
|
581
|
+
* Literal types and JSON shapes for maps. Database row types are in @playcademy/data/types.
|
|
582
|
+
*
|
|
583
|
+
* @module types/map
|
|
584
|
+
*/
|
|
585
|
+
/**
|
|
586
|
+
* Allowed map interaction types.
|
|
587
|
+
*/
|
|
588
|
+
type InteractionType = 'game_entry' | 'game_registry' | 'info' | 'teleport' | 'door_in' | 'door_out' | 'npc_interaction' | 'quest_trigger';
|
|
589
|
+
/**
|
|
590
|
+
* Metadata for interactive map elements.
|
|
591
|
+
*/
|
|
592
|
+
interface MapElementMetadata {
|
|
593
|
+
description?: string;
|
|
594
|
+
title?: string;
|
|
595
|
+
targetMapIdentifier?: string;
|
|
596
|
+
targetSpawnTileX?: number;
|
|
597
|
+
targetSpawnTileY?: number;
|
|
598
|
+
sourceTiledObjects?: Array<Record<string, unknown>>;
|
|
599
|
+
[key: string]: unknown;
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Metadata describing how an item should be placed on the map.
|
|
603
|
+
*/
|
|
604
|
+
interface PlaceableItemMetadata {
|
|
605
|
+
tilesWide?: number;
|
|
606
|
+
tilesHigh?: number;
|
|
607
|
+
flippable?: boolean;
|
|
608
|
+
[key: string]: unknown;
|
|
609
|
+
}
|
|
610
|
+
/**
|
|
611
|
+
* Simplified map data for API responses.
|
|
612
|
+
*/
|
|
613
|
+
interface MapData {
|
|
614
|
+
id: string;
|
|
615
|
+
identifier: string;
|
|
616
|
+
displayName: string;
|
|
617
|
+
description?: string | null;
|
|
618
|
+
metadata?: Record<string, unknown> | null;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Input for creating a map object.
|
|
622
|
+
*/
|
|
623
|
+
interface CreateMapObjectData {
|
|
624
|
+
itemId: string;
|
|
625
|
+
worldX: number;
|
|
626
|
+
worldY: number;
|
|
627
|
+
width?: number;
|
|
628
|
+
height?: number;
|
|
629
|
+
rotation?: number;
|
|
630
|
+
scale?: number;
|
|
631
|
+
metadata?: Record<string, unknown>;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Character & Avatar Types
|
|
636
|
+
*
|
|
637
|
+
* Literal types for character system. Database row types are in @playcademy/data/types.
|
|
638
|
+
*
|
|
639
|
+
* @module types/character
|
|
640
|
+
*/
|
|
641
|
+
/**
|
|
642
|
+
* Character component categories.
|
|
643
|
+
*/
|
|
644
|
+
type CharacterComponentType = 'body' | 'outfit' | 'hairstyle' | 'eyes' | 'accessory';
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Notification Types
|
|
648
|
+
*
|
|
649
|
+
* @module types/notification
|
|
650
|
+
*/
|
|
651
|
+
|
|
652
|
+
declare enum NotificationType {
|
|
653
|
+
ACHIEVEMENT = "achievement",
|
|
654
|
+
SYSTEM = "system",
|
|
655
|
+
PROMO = "promo"
|
|
656
|
+
}
|
|
657
|
+
declare enum NotificationStatus {
|
|
658
|
+
PENDING = "pending",
|
|
659
|
+
DELIVERED = "delivered",
|
|
660
|
+
SEEN = "seen",
|
|
661
|
+
CLICKED = "clicked",
|
|
662
|
+
DISMISSED = "dismissed",
|
|
663
|
+
EXPIRED = "expired"
|
|
664
|
+
}
|
|
665
|
+
interface NotificationStats {
|
|
666
|
+
total: number;
|
|
667
|
+
delivered: number;
|
|
668
|
+
seen: number;
|
|
669
|
+
clicked: number;
|
|
670
|
+
dismissed: number;
|
|
671
|
+
expired: number;
|
|
672
|
+
clickThroughRate: number;
|
|
673
|
+
}
|
|
674
|
+
|
|
24
675
|
declare const users: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
25
676
|
name: "user";
|
|
26
677
|
schema: undefined;
|
|
27
678
|
columns: {
|
|
28
679
|
id: drizzle_orm_pg_core.PgColumn<{
|
|
29
680
|
name: "id";
|
|
30
|
-
tableName: "user";
|
|
681
|
+
tableName: "user";
|
|
682
|
+
dataType: "string";
|
|
683
|
+
columnType: "PgText";
|
|
684
|
+
data: string;
|
|
685
|
+
driverParam: string;
|
|
686
|
+
notNull: true;
|
|
687
|
+
hasDefault: true;
|
|
688
|
+
isPrimaryKey: true;
|
|
689
|
+
isAutoincrement: false;
|
|
690
|
+
hasRuntimeDefault: true;
|
|
691
|
+
enumValues: [string, ...string[]];
|
|
692
|
+
baseColumn: never;
|
|
693
|
+
identity: undefined;
|
|
694
|
+
generated: undefined;
|
|
695
|
+
}, {}, {}>;
|
|
696
|
+
name: drizzle_orm_pg_core.PgColumn<{
|
|
697
|
+
name: "name";
|
|
698
|
+
tableName: "user";
|
|
699
|
+
dataType: "string";
|
|
700
|
+
columnType: "PgText";
|
|
701
|
+
data: string;
|
|
702
|
+
driverParam: string;
|
|
703
|
+
notNull: true;
|
|
704
|
+
hasDefault: false;
|
|
705
|
+
isPrimaryKey: false;
|
|
706
|
+
isAutoincrement: false;
|
|
707
|
+
hasRuntimeDefault: false;
|
|
708
|
+
enumValues: [string, ...string[]];
|
|
709
|
+
baseColumn: never;
|
|
710
|
+
identity: undefined;
|
|
711
|
+
generated: undefined;
|
|
712
|
+
}, {}, {}>;
|
|
713
|
+
username: drizzle_orm_pg_core.PgColumn<{
|
|
714
|
+
name: "username";
|
|
715
|
+
tableName: "user";
|
|
716
|
+
dataType: "string";
|
|
717
|
+
columnType: "PgText";
|
|
718
|
+
data: string;
|
|
719
|
+
driverParam: string;
|
|
720
|
+
notNull: false;
|
|
721
|
+
hasDefault: false;
|
|
722
|
+
isPrimaryKey: false;
|
|
723
|
+
isAutoincrement: false;
|
|
724
|
+
hasRuntimeDefault: false;
|
|
725
|
+
enumValues: [string, ...string[]];
|
|
726
|
+
baseColumn: never;
|
|
727
|
+
identity: undefined;
|
|
728
|
+
generated: undefined;
|
|
729
|
+
}, {}, {}>;
|
|
730
|
+
email: drizzle_orm_pg_core.PgColumn<{
|
|
731
|
+
name: "email";
|
|
732
|
+
tableName: "user";
|
|
733
|
+
dataType: "string";
|
|
734
|
+
columnType: "PgText";
|
|
735
|
+
data: string;
|
|
736
|
+
driverParam: string;
|
|
737
|
+
notNull: true;
|
|
738
|
+
hasDefault: false;
|
|
739
|
+
isPrimaryKey: false;
|
|
740
|
+
isAutoincrement: false;
|
|
741
|
+
hasRuntimeDefault: false;
|
|
742
|
+
enumValues: [string, ...string[]];
|
|
743
|
+
baseColumn: never;
|
|
744
|
+
identity: undefined;
|
|
745
|
+
generated: undefined;
|
|
746
|
+
}, {}, {}>;
|
|
747
|
+
timebackId: drizzle_orm_pg_core.PgColumn<{
|
|
748
|
+
name: "timeback_id";
|
|
749
|
+
tableName: "user";
|
|
750
|
+
dataType: "string";
|
|
751
|
+
columnType: "PgText";
|
|
752
|
+
data: string;
|
|
753
|
+
driverParam: string;
|
|
754
|
+
notNull: false;
|
|
755
|
+
hasDefault: false;
|
|
756
|
+
isPrimaryKey: false;
|
|
757
|
+
isAutoincrement: false;
|
|
758
|
+
hasRuntimeDefault: false;
|
|
759
|
+
enumValues: [string, ...string[]];
|
|
760
|
+
baseColumn: never;
|
|
761
|
+
identity: undefined;
|
|
762
|
+
generated: undefined;
|
|
763
|
+
}, {}, {}>;
|
|
764
|
+
emailVerified: drizzle_orm_pg_core.PgColumn<{
|
|
765
|
+
name: "email_verified";
|
|
766
|
+
tableName: "user";
|
|
767
|
+
dataType: "boolean";
|
|
768
|
+
columnType: "PgBoolean";
|
|
769
|
+
data: boolean;
|
|
770
|
+
driverParam: boolean;
|
|
771
|
+
notNull: true;
|
|
772
|
+
hasDefault: true;
|
|
773
|
+
isPrimaryKey: false;
|
|
774
|
+
isAutoincrement: false;
|
|
775
|
+
hasRuntimeDefault: false;
|
|
776
|
+
enumValues: undefined;
|
|
777
|
+
baseColumn: never;
|
|
778
|
+
identity: undefined;
|
|
779
|
+
generated: undefined;
|
|
780
|
+
}, {}, {}>;
|
|
781
|
+
image: drizzle_orm_pg_core.PgColumn<{
|
|
782
|
+
name: "image";
|
|
783
|
+
tableName: "user";
|
|
784
|
+
dataType: "string";
|
|
785
|
+
columnType: "PgText";
|
|
786
|
+
data: string;
|
|
787
|
+
driverParam: string;
|
|
788
|
+
notNull: false;
|
|
789
|
+
hasDefault: false;
|
|
790
|
+
isPrimaryKey: false;
|
|
791
|
+
isAutoincrement: false;
|
|
792
|
+
hasRuntimeDefault: false;
|
|
793
|
+
enumValues: [string, ...string[]];
|
|
794
|
+
baseColumn: never;
|
|
795
|
+
identity: undefined;
|
|
796
|
+
generated: undefined;
|
|
797
|
+
}, {}, {}>;
|
|
798
|
+
role: drizzle_orm_pg_core.PgColumn<{
|
|
799
|
+
name: "role";
|
|
800
|
+
tableName: "user";
|
|
801
|
+
dataType: "string";
|
|
802
|
+
columnType: "PgEnumColumn";
|
|
803
|
+
data: "admin" | "developer" | "player";
|
|
804
|
+
driverParam: string;
|
|
805
|
+
notNull: true;
|
|
806
|
+
hasDefault: true;
|
|
807
|
+
isPrimaryKey: false;
|
|
808
|
+
isAutoincrement: false;
|
|
809
|
+
hasRuntimeDefault: false;
|
|
810
|
+
enumValues: ["admin", "player", "developer"];
|
|
811
|
+
baseColumn: never;
|
|
812
|
+
identity: undefined;
|
|
813
|
+
generated: undefined;
|
|
814
|
+
}, {}, {}>;
|
|
815
|
+
developerStatus: drizzle_orm_pg_core.PgColumn<{
|
|
816
|
+
name: "developer_status";
|
|
817
|
+
tableName: "user";
|
|
818
|
+
dataType: "string";
|
|
819
|
+
columnType: "PgEnumColumn";
|
|
820
|
+
data: "approved" | "none" | "pending";
|
|
821
|
+
driverParam: string;
|
|
822
|
+
notNull: true;
|
|
823
|
+
hasDefault: true;
|
|
824
|
+
isPrimaryKey: false;
|
|
825
|
+
isAutoincrement: false;
|
|
826
|
+
hasRuntimeDefault: false;
|
|
827
|
+
enumValues: ["none", "pending", "approved"];
|
|
828
|
+
baseColumn: never;
|
|
829
|
+
identity: undefined;
|
|
830
|
+
generated: undefined;
|
|
831
|
+
}, {}, {}>;
|
|
832
|
+
characterCreated: drizzle_orm_pg_core.PgColumn<{
|
|
833
|
+
name: "character_created";
|
|
834
|
+
tableName: "user";
|
|
835
|
+
dataType: "boolean";
|
|
836
|
+
columnType: "PgBoolean";
|
|
837
|
+
data: boolean;
|
|
838
|
+
driverParam: boolean;
|
|
839
|
+
notNull: true;
|
|
840
|
+
hasDefault: true;
|
|
841
|
+
isPrimaryKey: false;
|
|
842
|
+
isAutoincrement: false;
|
|
843
|
+
hasRuntimeDefault: false;
|
|
844
|
+
enumValues: undefined;
|
|
845
|
+
baseColumn: never;
|
|
846
|
+
identity: undefined;
|
|
847
|
+
generated: undefined;
|
|
848
|
+
}, {}, {}>;
|
|
849
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
850
|
+
name: "created_at";
|
|
851
|
+
tableName: "user";
|
|
852
|
+
dataType: "date";
|
|
853
|
+
columnType: "PgTimestamp";
|
|
854
|
+
data: Date;
|
|
855
|
+
driverParam: string;
|
|
856
|
+
notNull: true;
|
|
857
|
+
hasDefault: false;
|
|
858
|
+
isPrimaryKey: false;
|
|
859
|
+
isAutoincrement: false;
|
|
860
|
+
hasRuntimeDefault: false;
|
|
861
|
+
enumValues: undefined;
|
|
862
|
+
baseColumn: never;
|
|
863
|
+
identity: undefined;
|
|
864
|
+
generated: undefined;
|
|
865
|
+
}, {}, {}>;
|
|
866
|
+
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
867
|
+
name: "updated_at";
|
|
868
|
+
tableName: "user";
|
|
869
|
+
dataType: "date";
|
|
870
|
+
columnType: "PgTimestamp";
|
|
871
|
+
data: Date;
|
|
872
|
+
driverParam: string;
|
|
873
|
+
notNull: true;
|
|
874
|
+
hasDefault: false;
|
|
875
|
+
isPrimaryKey: false;
|
|
876
|
+
isAutoincrement: false;
|
|
877
|
+
hasRuntimeDefault: false;
|
|
878
|
+
enumValues: undefined;
|
|
879
|
+
baseColumn: never;
|
|
880
|
+
identity: undefined;
|
|
881
|
+
generated: undefined;
|
|
882
|
+
}, {}, {}>;
|
|
883
|
+
};
|
|
884
|
+
dialect: "pg";
|
|
885
|
+
}>;
|
|
886
|
+
|
|
887
|
+
type GameMetadata = {
|
|
888
|
+
description?: string;
|
|
889
|
+
emoji?: string;
|
|
890
|
+
[key: string]: unknown;
|
|
891
|
+
};
|
|
892
|
+
/**
|
|
893
|
+
* DNS validation records for custom hostname
|
|
894
|
+
* Structure for the validationRecords JSON field in game_custom_hostnames table
|
|
895
|
+
*/
|
|
896
|
+
type CustomHostnameValidationRecords = {
|
|
897
|
+
/** TXT record for ownership verification */
|
|
898
|
+
ownership?: {
|
|
899
|
+
name?: string;
|
|
900
|
+
value?: string;
|
|
901
|
+
type?: string;
|
|
902
|
+
};
|
|
903
|
+
/** TXT records for SSL certificate validation */
|
|
904
|
+
ssl?: Array<{
|
|
905
|
+
txt_name?: string;
|
|
906
|
+
txt_value?: string;
|
|
907
|
+
}>;
|
|
908
|
+
};
|
|
909
|
+
declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
910
|
+
name: "games";
|
|
911
|
+
schema: undefined;
|
|
912
|
+
columns: {
|
|
913
|
+
id: drizzle_orm_pg_core.PgColumn<{
|
|
914
|
+
name: "id";
|
|
915
|
+
tableName: "games";
|
|
916
|
+
dataType: "string";
|
|
917
|
+
columnType: "PgUUID";
|
|
918
|
+
data: string;
|
|
919
|
+
driverParam: string;
|
|
920
|
+
notNull: true;
|
|
921
|
+
hasDefault: true;
|
|
922
|
+
isPrimaryKey: true;
|
|
923
|
+
isAutoincrement: false;
|
|
924
|
+
hasRuntimeDefault: false;
|
|
925
|
+
enumValues: undefined;
|
|
926
|
+
baseColumn: never;
|
|
927
|
+
identity: undefined;
|
|
928
|
+
generated: undefined;
|
|
929
|
+
}, {}, {}>;
|
|
930
|
+
developerId: drizzle_orm_pg_core.PgColumn<{
|
|
931
|
+
name: "developer_id";
|
|
932
|
+
tableName: "games";
|
|
933
|
+
dataType: "string";
|
|
934
|
+
columnType: "PgText";
|
|
935
|
+
data: string;
|
|
936
|
+
driverParam: string;
|
|
937
|
+
notNull: false;
|
|
938
|
+
hasDefault: false;
|
|
939
|
+
isPrimaryKey: false;
|
|
940
|
+
isAutoincrement: false;
|
|
941
|
+
hasRuntimeDefault: false;
|
|
942
|
+
enumValues: [string, ...string[]];
|
|
943
|
+
baseColumn: never;
|
|
944
|
+
identity: undefined;
|
|
945
|
+
generated: undefined;
|
|
946
|
+
}, {}, {}>;
|
|
947
|
+
slug: drizzle_orm_pg_core.PgColumn<{
|
|
948
|
+
name: "slug";
|
|
949
|
+
tableName: "games";
|
|
950
|
+
dataType: "string";
|
|
951
|
+
columnType: "PgVarchar";
|
|
952
|
+
data: string;
|
|
953
|
+
driverParam: string;
|
|
954
|
+
notNull: true;
|
|
955
|
+
hasDefault: false;
|
|
956
|
+
isPrimaryKey: false;
|
|
957
|
+
isAutoincrement: false;
|
|
958
|
+
hasRuntimeDefault: false;
|
|
959
|
+
enumValues: [string, ...string[]];
|
|
960
|
+
baseColumn: never;
|
|
961
|
+
identity: undefined;
|
|
962
|
+
generated: undefined;
|
|
963
|
+
}, {}, {
|
|
964
|
+
length: 255;
|
|
965
|
+
}>;
|
|
966
|
+
displayName: drizzle_orm_pg_core.PgColumn<{
|
|
967
|
+
name: "display_name";
|
|
968
|
+
tableName: "games";
|
|
969
|
+
dataType: "string";
|
|
970
|
+
columnType: "PgVarchar";
|
|
971
|
+
data: string;
|
|
972
|
+
driverParam: string;
|
|
973
|
+
notNull: true;
|
|
974
|
+
hasDefault: false;
|
|
975
|
+
isPrimaryKey: false;
|
|
976
|
+
isAutoincrement: false;
|
|
977
|
+
hasRuntimeDefault: false;
|
|
978
|
+
enumValues: [string, ...string[]];
|
|
979
|
+
baseColumn: never;
|
|
980
|
+
identity: undefined;
|
|
981
|
+
generated: undefined;
|
|
982
|
+
}, {}, {
|
|
983
|
+
length: 255;
|
|
984
|
+
}>;
|
|
985
|
+
version: drizzle_orm_pg_core.PgColumn<{
|
|
986
|
+
name: "version";
|
|
987
|
+
tableName: "games";
|
|
988
|
+
dataType: "string";
|
|
989
|
+
columnType: "PgVarchar";
|
|
990
|
+
data: string;
|
|
991
|
+
driverParam: string;
|
|
992
|
+
notNull: true;
|
|
993
|
+
hasDefault: false;
|
|
994
|
+
isPrimaryKey: false;
|
|
995
|
+
isAutoincrement: false;
|
|
996
|
+
hasRuntimeDefault: false;
|
|
997
|
+
enumValues: [string, ...string[]];
|
|
998
|
+
baseColumn: never;
|
|
999
|
+
identity: undefined;
|
|
1000
|
+
generated: undefined;
|
|
1001
|
+
}, {}, {
|
|
1002
|
+
length: 50;
|
|
1003
|
+
}>;
|
|
1004
|
+
gameType: drizzle_orm_pg_core.PgColumn<{
|
|
1005
|
+
name: "game_type";
|
|
1006
|
+
tableName: "games";
|
|
1007
|
+
dataType: "string";
|
|
1008
|
+
columnType: "PgEnumColumn";
|
|
1009
|
+
data: "external" | "hosted";
|
|
1010
|
+
driverParam: string;
|
|
1011
|
+
notNull: true;
|
|
1012
|
+
hasDefault: true;
|
|
1013
|
+
isPrimaryKey: false;
|
|
1014
|
+
isAutoincrement: false;
|
|
1015
|
+
hasRuntimeDefault: false;
|
|
1016
|
+
enumValues: ["hosted", "external"];
|
|
1017
|
+
baseColumn: never;
|
|
1018
|
+
identity: undefined;
|
|
1019
|
+
generated: undefined;
|
|
1020
|
+
}, {}, {}>;
|
|
1021
|
+
deploymentUrl: drizzle_orm_pg_core.PgColumn<{
|
|
1022
|
+
name: "deployment_url";
|
|
1023
|
+
tableName: "games";
|
|
1024
|
+
dataType: "string";
|
|
1025
|
+
columnType: "PgText";
|
|
1026
|
+
data: string;
|
|
1027
|
+
driverParam: string;
|
|
1028
|
+
notNull: false;
|
|
1029
|
+
hasDefault: false;
|
|
1030
|
+
isPrimaryKey: false;
|
|
1031
|
+
isAutoincrement: false;
|
|
1032
|
+
hasRuntimeDefault: false;
|
|
1033
|
+
enumValues: [string, ...string[]];
|
|
1034
|
+
baseColumn: never;
|
|
1035
|
+
identity: undefined;
|
|
1036
|
+
generated: undefined;
|
|
1037
|
+
}, {}, {}>;
|
|
1038
|
+
externalUrl: drizzle_orm_pg_core.PgColumn<{
|
|
1039
|
+
name: "external_url";
|
|
1040
|
+
tableName: "games";
|
|
1041
|
+
dataType: "string";
|
|
1042
|
+
columnType: "PgText";
|
|
1043
|
+
data: string;
|
|
1044
|
+
driverParam: string;
|
|
1045
|
+
notNull: false;
|
|
1046
|
+
hasDefault: false;
|
|
1047
|
+
isPrimaryKey: false;
|
|
1048
|
+
isAutoincrement: false;
|
|
1049
|
+
hasRuntimeDefault: false;
|
|
1050
|
+
enumValues: [string, ...string[]];
|
|
1051
|
+
baseColumn: never;
|
|
1052
|
+
identity: undefined;
|
|
1053
|
+
generated: undefined;
|
|
1054
|
+
}, {}, {}>;
|
|
1055
|
+
platform: drizzle_orm_pg_core.PgColumn<{
|
|
1056
|
+
name: "platform";
|
|
1057
|
+
tableName: "games";
|
|
1058
|
+
dataType: "string";
|
|
1059
|
+
columnType: "PgEnumColumn";
|
|
1060
|
+
data: "godot" | "unity" | "web";
|
|
1061
|
+
driverParam: string;
|
|
1062
|
+
notNull: true;
|
|
1063
|
+
hasDefault: true;
|
|
1064
|
+
isPrimaryKey: false;
|
|
1065
|
+
isAutoincrement: false;
|
|
1066
|
+
hasRuntimeDefault: false;
|
|
1067
|
+
enumValues: ["web", "godot", "unity"];
|
|
1068
|
+
baseColumn: never;
|
|
1069
|
+
identity: undefined;
|
|
1070
|
+
generated: undefined;
|
|
1071
|
+
}, {}, {}>;
|
|
1072
|
+
mapElementId: drizzle_orm_pg_core.PgColumn<{
|
|
1073
|
+
name: "map_element_id";
|
|
1074
|
+
tableName: "games";
|
|
1075
|
+
dataType: "string";
|
|
1076
|
+
columnType: "PgUUID";
|
|
1077
|
+
data: string;
|
|
1078
|
+
driverParam: string;
|
|
1079
|
+
notNull: false;
|
|
1080
|
+
hasDefault: false;
|
|
1081
|
+
isPrimaryKey: false;
|
|
1082
|
+
isAutoincrement: false;
|
|
1083
|
+
hasRuntimeDefault: false;
|
|
1084
|
+
enumValues: undefined;
|
|
1085
|
+
baseColumn: never;
|
|
1086
|
+
identity: undefined;
|
|
1087
|
+
generated: undefined;
|
|
1088
|
+
}, {}, {}>;
|
|
1089
|
+
metadata: drizzle_orm_pg_core.PgColumn<{
|
|
1090
|
+
name: "metadata";
|
|
1091
|
+
tableName: "games";
|
|
1092
|
+
dataType: "json";
|
|
1093
|
+
columnType: "PgJsonb";
|
|
1094
|
+
data: GameMetadata;
|
|
1095
|
+
driverParam: unknown;
|
|
1096
|
+
notNull: true;
|
|
1097
|
+
hasDefault: true;
|
|
1098
|
+
isPrimaryKey: false;
|
|
1099
|
+
isAutoincrement: false;
|
|
1100
|
+
hasRuntimeDefault: false;
|
|
1101
|
+
enumValues: undefined;
|
|
1102
|
+
baseColumn: never;
|
|
1103
|
+
identity: undefined;
|
|
1104
|
+
generated: undefined;
|
|
1105
|
+
}, {}, {
|
|
1106
|
+
$type: GameMetadata;
|
|
1107
|
+
}>;
|
|
1108
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
1109
|
+
name: "created_at";
|
|
1110
|
+
tableName: "games";
|
|
1111
|
+
dataType: "date";
|
|
1112
|
+
columnType: "PgTimestamp";
|
|
1113
|
+
data: Date;
|
|
1114
|
+
driverParam: string;
|
|
1115
|
+
notNull: false;
|
|
1116
|
+
hasDefault: true;
|
|
1117
|
+
isPrimaryKey: false;
|
|
1118
|
+
isAutoincrement: false;
|
|
1119
|
+
hasRuntimeDefault: false;
|
|
1120
|
+
enumValues: undefined;
|
|
1121
|
+
baseColumn: never;
|
|
1122
|
+
identity: undefined;
|
|
1123
|
+
generated: undefined;
|
|
1124
|
+
}, {}, {}>;
|
|
1125
|
+
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
1126
|
+
name: "updated_at";
|
|
1127
|
+
tableName: "games";
|
|
1128
|
+
dataType: "date";
|
|
1129
|
+
columnType: "PgTimestamp";
|
|
1130
|
+
data: Date;
|
|
1131
|
+
driverParam: string;
|
|
1132
|
+
notNull: false;
|
|
1133
|
+
hasDefault: true;
|
|
1134
|
+
isPrimaryKey: false;
|
|
1135
|
+
isAutoincrement: false;
|
|
1136
|
+
hasRuntimeDefault: false;
|
|
1137
|
+
enumValues: undefined;
|
|
1138
|
+
baseColumn: never;
|
|
1139
|
+
identity: undefined;
|
|
1140
|
+
generated: undefined;
|
|
1141
|
+
}, {}, {}>;
|
|
1142
|
+
};
|
|
1143
|
+
dialect: "pg";
|
|
1144
|
+
}>;
|
|
1145
|
+
declare const gameSessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
1146
|
+
name: "game_sessions";
|
|
1147
|
+
schema: undefined;
|
|
1148
|
+
columns: {
|
|
1149
|
+
id: drizzle_orm_pg_core.PgColumn<{
|
|
1150
|
+
name: "id";
|
|
1151
|
+
tableName: "game_sessions";
|
|
31
1152
|
dataType: "string";
|
|
32
|
-
columnType: "
|
|
1153
|
+
columnType: "PgUUID";
|
|
33
1154
|
data: string;
|
|
34
1155
|
driverParam: string;
|
|
35
1156
|
notNull: true;
|
|
36
1157
|
hasDefault: true;
|
|
37
1158
|
isPrimaryKey: true;
|
|
38
1159
|
isAutoincrement: false;
|
|
39
|
-
hasRuntimeDefault:
|
|
40
|
-
enumValues:
|
|
1160
|
+
hasRuntimeDefault: false;
|
|
1161
|
+
enumValues: undefined;
|
|
41
1162
|
baseColumn: never;
|
|
42
1163
|
identity: undefined;
|
|
43
1164
|
generated: undefined;
|
|
44
1165
|
}, {}, {}>;
|
|
45
|
-
|
|
46
|
-
name: "
|
|
47
|
-
tableName: "
|
|
1166
|
+
userId: drizzle_orm_pg_core.PgColumn<{
|
|
1167
|
+
name: "user_id";
|
|
1168
|
+
tableName: "game_sessions";
|
|
48
1169
|
dataType: "string";
|
|
49
1170
|
columnType: "PgText";
|
|
50
1171
|
data: string;
|
|
@@ -59,28 +1180,91 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
59
1180
|
identity: undefined;
|
|
60
1181
|
generated: undefined;
|
|
61
1182
|
}, {}, {}>;
|
|
62
|
-
|
|
63
|
-
name: "
|
|
64
|
-
tableName: "
|
|
1183
|
+
gameId: drizzle_orm_pg_core.PgColumn<{
|
|
1184
|
+
name: "game_id";
|
|
1185
|
+
tableName: "game_sessions";
|
|
65
1186
|
dataType: "string";
|
|
66
|
-
columnType: "
|
|
1187
|
+
columnType: "PgUUID";
|
|
67
1188
|
data: string;
|
|
68
1189
|
driverParam: string;
|
|
1190
|
+
notNull: true;
|
|
1191
|
+
hasDefault: false;
|
|
1192
|
+
isPrimaryKey: false;
|
|
1193
|
+
isAutoincrement: false;
|
|
1194
|
+
hasRuntimeDefault: false;
|
|
1195
|
+
enumValues: undefined;
|
|
1196
|
+
baseColumn: never;
|
|
1197
|
+
identity: undefined;
|
|
1198
|
+
generated: undefined;
|
|
1199
|
+
}, {}, {}>;
|
|
1200
|
+
startedAt: drizzle_orm_pg_core.PgColumn<{
|
|
1201
|
+
name: "started_at";
|
|
1202
|
+
tableName: "game_sessions";
|
|
1203
|
+
dataType: "date";
|
|
1204
|
+
columnType: "PgTimestamp";
|
|
1205
|
+
data: Date;
|
|
1206
|
+
driverParam: string;
|
|
1207
|
+
notNull: true;
|
|
1208
|
+
hasDefault: true;
|
|
1209
|
+
isPrimaryKey: false;
|
|
1210
|
+
isAutoincrement: false;
|
|
1211
|
+
hasRuntimeDefault: false;
|
|
1212
|
+
enumValues: undefined;
|
|
1213
|
+
baseColumn: never;
|
|
1214
|
+
identity: undefined;
|
|
1215
|
+
generated: undefined;
|
|
1216
|
+
}, {}, {}>;
|
|
1217
|
+
endedAt: drizzle_orm_pg_core.PgColumn<{
|
|
1218
|
+
name: "ended_at";
|
|
1219
|
+
tableName: "game_sessions";
|
|
1220
|
+
dataType: "date";
|
|
1221
|
+
columnType: "PgTimestamp";
|
|
1222
|
+
data: Date;
|
|
1223
|
+
driverParam: string;
|
|
69
1224
|
notNull: false;
|
|
70
1225
|
hasDefault: false;
|
|
71
1226
|
isPrimaryKey: false;
|
|
72
1227
|
isAutoincrement: false;
|
|
73
1228
|
hasRuntimeDefault: false;
|
|
74
|
-
enumValues:
|
|
1229
|
+
enumValues: undefined;
|
|
75
1230
|
baseColumn: never;
|
|
76
1231
|
identity: undefined;
|
|
77
1232
|
generated: undefined;
|
|
78
1233
|
}, {}, {}>;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
1234
|
+
};
|
|
1235
|
+
dialect: "pg";
|
|
1236
|
+
}>;
|
|
1237
|
+
/**
|
|
1238
|
+
* Custom hostnames table
|
|
1239
|
+
*
|
|
1240
|
+
* Stores custom domain mappings for games with SSL provisioning via Cloudflare.
|
|
1241
|
+
*/
|
|
1242
|
+
declare const gameCustomHostnames: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
1243
|
+
name: "game_custom_hostnames";
|
|
1244
|
+
schema: undefined;
|
|
1245
|
+
columns: {
|
|
1246
|
+
id: drizzle_orm_pg_core.PgColumn<{
|
|
1247
|
+
name: "id";
|
|
1248
|
+
tableName: "game_custom_hostnames";
|
|
82
1249
|
dataType: "string";
|
|
83
|
-
columnType: "
|
|
1250
|
+
columnType: "PgUUID";
|
|
1251
|
+
data: string;
|
|
1252
|
+
driverParam: string;
|
|
1253
|
+
notNull: true;
|
|
1254
|
+
hasDefault: true;
|
|
1255
|
+
isPrimaryKey: true;
|
|
1256
|
+
isAutoincrement: false;
|
|
1257
|
+
hasRuntimeDefault: false;
|
|
1258
|
+
enumValues: undefined;
|
|
1259
|
+
baseColumn: never;
|
|
1260
|
+
identity: undefined;
|
|
1261
|
+
generated: undefined;
|
|
1262
|
+
}, {}, {}>;
|
|
1263
|
+
gameId: drizzle_orm_pg_core.PgColumn<{
|
|
1264
|
+
name: "game_id";
|
|
1265
|
+
tableName: "game_custom_hostnames";
|
|
1266
|
+
dataType: "string";
|
|
1267
|
+
columnType: "PgUUID";
|
|
84
1268
|
data: string;
|
|
85
1269
|
driverParam: string;
|
|
86
1270
|
notNull: true;
|
|
@@ -88,19 +1272,19 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
88
1272
|
isPrimaryKey: false;
|
|
89
1273
|
isAutoincrement: false;
|
|
90
1274
|
hasRuntimeDefault: false;
|
|
91
|
-
enumValues:
|
|
1275
|
+
enumValues: undefined;
|
|
92
1276
|
baseColumn: never;
|
|
93
1277
|
identity: undefined;
|
|
94
1278
|
generated: undefined;
|
|
95
1279
|
}, {}, {}>;
|
|
96
|
-
|
|
97
|
-
name: "
|
|
98
|
-
tableName: "
|
|
1280
|
+
userId: drizzle_orm_pg_core.PgColumn<{
|
|
1281
|
+
name: "user_id";
|
|
1282
|
+
tableName: "game_custom_hostnames";
|
|
99
1283
|
dataType: "string";
|
|
100
1284
|
columnType: "PgText";
|
|
101
1285
|
data: string;
|
|
102
1286
|
driverParam: string;
|
|
103
|
-
notNull:
|
|
1287
|
+
notNull: true;
|
|
104
1288
|
hasDefault: false;
|
|
105
1289
|
isPrimaryKey: false;
|
|
106
1290
|
isAutoincrement: false;
|
|
@@ -110,31 +1294,31 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
110
1294
|
identity: undefined;
|
|
111
1295
|
generated: undefined;
|
|
112
1296
|
}, {}, {}>;
|
|
113
|
-
|
|
114
|
-
name: "
|
|
115
|
-
tableName: "
|
|
116
|
-
dataType: "
|
|
117
|
-
columnType: "
|
|
118
|
-
data:
|
|
119
|
-
driverParam:
|
|
1297
|
+
hostname: drizzle_orm_pg_core.PgColumn<{
|
|
1298
|
+
name: "hostname";
|
|
1299
|
+
tableName: "game_custom_hostnames";
|
|
1300
|
+
dataType: "string";
|
|
1301
|
+
columnType: "PgText";
|
|
1302
|
+
data: string;
|
|
1303
|
+
driverParam: string;
|
|
120
1304
|
notNull: true;
|
|
121
|
-
hasDefault:
|
|
1305
|
+
hasDefault: false;
|
|
122
1306
|
isPrimaryKey: false;
|
|
123
1307
|
isAutoincrement: false;
|
|
124
1308
|
hasRuntimeDefault: false;
|
|
125
|
-
enumValues:
|
|
1309
|
+
enumValues: [string, ...string[]];
|
|
126
1310
|
baseColumn: never;
|
|
127
1311
|
identity: undefined;
|
|
128
1312
|
generated: undefined;
|
|
129
1313
|
}, {}, {}>;
|
|
130
|
-
|
|
131
|
-
name: "
|
|
132
|
-
tableName: "
|
|
1314
|
+
cloudflareId: drizzle_orm_pg_core.PgColumn<{
|
|
1315
|
+
name: "cloudflare_id";
|
|
1316
|
+
tableName: "game_custom_hostnames";
|
|
133
1317
|
dataType: "string";
|
|
134
1318
|
columnType: "PgText";
|
|
135
1319
|
data: string;
|
|
136
1320
|
driverParam: string;
|
|
137
|
-
notNull:
|
|
1321
|
+
notNull: true;
|
|
138
1322
|
hasDefault: false;
|
|
139
1323
|
isPrimaryKey: false;
|
|
140
1324
|
isAutoincrement: false;
|
|
@@ -144,66 +1328,85 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
144
1328
|
identity: undefined;
|
|
145
1329
|
generated: undefined;
|
|
146
1330
|
}, {}, {}>;
|
|
147
|
-
|
|
148
|
-
name: "
|
|
149
|
-
tableName: "
|
|
1331
|
+
environment: drizzle_orm_pg_core.PgColumn<{
|
|
1332
|
+
name: "environment";
|
|
1333
|
+
tableName: "game_custom_hostnames";
|
|
150
1334
|
dataType: "string";
|
|
151
1335
|
columnType: "PgEnumColumn";
|
|
152
|
-
data: "
|
|
1336
|
+
data: "production" | "staging";
|
|
153
1337
|
driverParam: string;
|
|
154
1338
|
notNull: true;
|
|
155
1339
|
hasDefault: true;
|
|
156
1340
|
isPrimaryKey: false;
|
|
157
1341
|
isAutoincrement: false;
|
|
158
1342
|
hasRuntimeDefault: false;
|
|
159
|
-
enumValues: ["
|
|
1343
|
+
enumValues: ["staging", "production"];
|
|
160
1344
|
baseColumn: never;
|
|
161
1345
|
identity: undefined;
|
|
162
1346
|
generated: undefined;
|
|
163
1347
|
}, {}, {}>;
|
|
164
|
-
|
|
165
|
-
name: "
|
|
166
|
-
tableName: "
|
|
1348
|
+
status: drizzle_orm_pg_core.PgColumn<{
|
|
1349
|
+
name: "status";
|
|
1350
|
+
tableName: "game_custom_hostnames";
|
|
167
1351
|
dataType: "string";
|
|
168
1352
|
columnType: "PgEnumColumn";
|
|
169
|
-
data: "
|
|
1353
|
+
data: "active" | "blocked" | "deleted" | "pending" | "pending_deletion" | "pending_deployment" | "pending_validation";
|
|
170
1354
|
driverParam: string;
|
|
171
1355
|
notNull: true;
|
|
172
1356
|
hasDefault: true;
|
|
173
1357
|
isPrimaryKey: false;
|
|
174
1358
|
isAutoincrement: false;
|
|
175
1359
|
hasRuntimeDefault: false;
|
|
176
|
-
enumValues: ["
|
|
1360
|
+
enumValues: ["pending", "pending_validation", "pending_deployment", "pending_deletion", "active", "blocked", "deleted"];
|
|
177
1361
|
baseColumn: never;
|
|
178
1362
|
identity: undefined;
|
|
179
1363
|
generated: undefined;
|
|
180
1364
|
}, {}, {}>;
|
|
181
|
-
|
|
182
|
-
name: "
|
|
183
|
-
tableName: "
|
|
184
|
-
dataType: "
|
|
185
|
-
columnType: "
|
|
186
|
-
data:
|
|
187
|
-
driverParam:
|
|
1365
|
+
sslStatus: drizzle_orm_pg_core.PgColumn<{
|
|
1366
|
+
name: "ssl_status";
|
|
1367
|
+
tableName: "game_custom_hostnames";
|
|
1368
|
+
dataType: "string";
|
|
1369
|
+
columnType: "PgEnumColumn";
|
|
1370
|
+
data: "active" | "deleted" | "initializing" | "pending_deployment" | "pending_issuance" | "pending_validation";
|
|
1371
|
+
driverParam: string;
|
|
188
1372
|
notNull: true;
|
|
189
1373
|
hasDefault: true;
|
|
190
1374
|
isPrimaryKey: false;
|
|
191
1375
|
isAutoincrement: false;
|
|
192
1376
|
hasRuntimeDefault: false;
|
|
193
|
-
enumValues:
|
|
1377
|
+
enumValues: ["initializing", "pending_validation", "pending_issuance", "pending_deployment", "active", "deleted"];
|
|
194
1378
|
baseColumn: never;
|
|
195
1379
|
identity: undefined;
|
|
196
1380
|
generated: undefined;
|
|
197
1381
|
}, {}, {}>;
|
|
1382
|
+
validationRecords: drizzle_orm_pg_core.PgColumn<{
|
|
1383
|
+
name: "validation_records";
|
|
1384
|
+
tableName: "game_custom_hostnames";
|
|
1385
|
+
dataType: "json";
|
|
1386
|
+
columnType: "PgJsonb";
|
|
1387
|
+
data: CustomHostnameValidationRecords;
|
|
1388
|
+
driverParam: unknown;
|
|
1389
|
+
notNull: false;
|
|
1390
|
+
hasDefault: false;
|
|
1391
|
+
isPrimaryKey: false;
|
|
1392
|
+
isAutoincrement: false;
|
|
1393
|
+
hasRuntimeDefault: false;
|
|
1394
|
+
enumValues: undefined;
|
|
1395
|
+
baseColumn: never;
|
|
1396
|
+
identity: undefined;
|
|
1397
|
+
generated: undefined;
|
|
1398
|
+
}, {}, {
|
|
1399
|
+
$type: CustomHostnameValidationRecords;
|
|
1400
|
+
}>;
|
|
198
1401
|
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
199
1402
|
name: "created_at";
|
|
200
|
-
tableName: "
|
|
1403
|
+
tableName: "game_custom_hostnames";
|
|
201
1404
|
dataType: "date";
|
|
202
1405
|
columnType: "PgTimestamp";
|
|
203
1406
|
data: Date;
|
|
204
1407
|
driverParam: string;
|
|
205
1408
|
notNull: true;
|
|
206
|
-
hasDefault:
|
|
1409
|
+
hasDefault: true;
|
|
207
1410
|
isPrimaryKey: false;
|
|
208
1411
|
isAutoincrement: false;
|
|
209
1412
|
hasRuntimeDefault: false;
|
|
@@ -214,13 +1417,13 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
214
1417
|
}, {}, {}>;
|
|
215
1418
|
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
216
1419
|
name: "updated_at";
|
|
217
|
-
tableName: "
|
|
1420
|
+
tableName: "game_custom_hostnames";
|
|
218
1421
|
dataType: "date";
|
|
219
1422
|
columnType: "PgTimestamp";
|
|
220
1423
|
data: Date;
|
|
221
1424
|
driverParam: string;
|
|
222
1425
|
notNull: true;
|
|
223
|
-
hasDefault:
|
|
1426
|
+
hasDefault: true;
|
|
224
1427
|
isPrimaryKey: false;
|
|
225
1428
|
isAutoincrement: false;
|
|
226
1429
|
hasRuntimeDefault: false;
|
|
@@ -232,19 +1435,13 @@ declare const users: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
232
1435
|
};
|
|
233
1436
|
dialect: "pg";
|
|
234
1437
|
}>;
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
description?: string;
|
|
238
|
-
emoji?: string;
|
|
239
|
-
[key: string]: unknown;
|
|
240
|
-
};
|
|
241
|
-
declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
242
|
-
name: "games";
|
|
1438
|
+
declare const items: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
1439
|
+
name: "items";
|
|
243
1440
|
schema: undefined;
|
|
244
1441
|
columns: {
|
|
245
1442
|
id: drizzle_orm_pg_core.PgColumn<{
|
|
246
1443
|
name: "id";
|
|
247
|
-
tableName: "
|
|
1444
|
+
tableName: "items";
|
|
248
1445
|
dataType: "string";
|
|
249
1446
|
columnType: "PgUUID";
|
|
250
1447
|
data: string;
|
|
@@ -254,71 +1451,16 @@ declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
254
1451
|
isPrimaryKey: true;
|
|
255
1452
|
isAutoincrement: false;
|
|
256
1453
|
hasRuntimeDefault: false;
|
|
257
|
-
enumValues: undefined;
|
|
258
|
-
baseColumn: never;
|
|
259
|
-
identity: undefined;
|
|
260
|
-
generated: undefined;
|
|
261
|
-
}, {}, {}>;
|
|
262
|
-
|
|
263
|
-
name: "
|
|
264
|
-
tableName: "
|
|
265
|
-
dataType: "string";
|
|
266
|
-
columnType: "PgText";
|
|
267
|
-
data: string;
|
|
268
|
-
driverParam: string;
|
|
269
|
-
notNull: false;
|
|
270
|
-
hasDefault: false;
|
|
271
|
-
isPrimaryKey: false;
|
|
272
|
-
isAutoincrement: false;
|
|
273
|
-
hasRuntimeDefault: false;
|
|
274
|
-
enumValues: [string, ...string[]];
|
|
275
|
-
baseColumn: never;
|
|
276
|
-
identity: undefined;
|
|
277
|
-
generated: undefined;
|
|
278
|
-
}, {}, {}>;
|
|
279
|
-
slug: drizzle_orm_pg_core.PgColumn<{
|
|
280
|
-
name: "slug";
|
|
281
|
-
tableName: "games";
|
|
282
|
-
dataType: "string";
|
|
283
|
-
columnType: "PgVarchar";
|
|
284
|
-
data: string;
|
|
285
|
-
driverParam: string;
|
|
286
|
-
notNull: true;
|
|
287
|
-
hasDefault: false;
|
|
288
|
-
isPrimaryKey: false;
|
|
289
|
-
isAutoincrement: false;
|
|
290
|
-
hasRuntimeDefault: false;
|
|
291
|
-
enumValues: [string, ...string[]];
|
|
292
|
-
baseColumn: never;
|
|
293
|
-
identity: undefined;
|
|
294
|
-
generated: undefined;
|
|
295
|
-
}, {}, {
|
|
296
|
-
length: 255;
|
|
297
|
-
}>;
|
|
298
|
-
displayName: drizzle_orm_pg_core.PgColumn<{
|
|
299
|
-
name: "display_name";
|
|
300
|
-
tableName: "games";
|
|
301
|
-
dataType: "string";
|
|
302
|
-
columnType: "PgVarchar";
|
|
303
|
-
data: string;
|
|
304
|
-
driverParam: string;
|
|
305
|
-
notNull: true;
|
|
306
|
-
hasDefault: false;
|
|
307
|
-
isPrimaryKey: false;
|
|
308
|
-
isAutoincrement: false;
|
|
309
|
-
hasRuntimeDefault: false;
|
|
310
|
-
enumValues: [string, ...string[]];
|
|
311
|
-
baseColumn: never;
|
|
312
|
-
identity: undefined;
|
|
313
|
-
generated: undefined;
|
|
314
|
-
}, {}, {
|
|
315
|
-
length: 255;
|
|
316
|
-
}>;
|
|
317
|
-
version: drizzle_orm_pg_core.PgColumn<{
|
|
318
|
-
name: "version";
|
|
319
|
-
tableName: "games";
|
|
1454
|
+
enumValues: undefined;
|
|
1455
|
+
baseColumn: never;
|
|
1456
|
+
identity: undefined;
|
|
1457
|
+
generated: undefined;
|
|
1458
|
+
}, {}, {}>;
|
|
1459
|
+
slug: drizzle_orm_pg_core.PgColumn<{
|
|
1460
|
+
name: "slug";
|
|
1461
|
+
tableName: "items";
|
|
320
1462
|
dataType: "string";
|
|
321
|
-
columnType: "
|
|
1463
|
+
columnType: "PgText";
|
|
322
1464
|
data: string;
|
|
323
1465
|
driverParam: string;
|
|
324
1466
|
notNull: true;
|
|
@@ -330,34 +1472,32 @@ declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
330
1472
|
baseColumn: never;
|
|
331
1473
|
identity: undefined;
|
|
332
1474
|
generated: undefined;
|
|
333
|
-
}, {}, {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
name: "game_type";
|
|
338
|
-
tableName: "games";
|
|
1475
|
+
}, {}, {}>;
|
|
1476
|
+
gameId: drizzle_orm_pg_core.PgColumn<{
|
|
1477
|
+
name: "game_id";
|
|
1478
|
+
tableName: "items";
|
|
339
1479
|
dataType: "string";
|
|
340
|
-
columnType: "
|
|
341
|
-
data:
|
|
1480
|
+
columnType: "PgUUID";
|
|
1481
|
+
data: string;
|
|
342
1482
|
driverParam: string;
|
|
343
|
-
notNull:
|
|
344
|
-
hasDefault:
|
|
1483
|
+
notNull: false;
|
|
1484
|
+
hasDefault: false;
|
|
345
1485
|
isPrimaryKey: false;
|
|
346
1486
|
isAutoincrement: false;
|
|
347
1487
|
hasRuntimeDefault: false;
|
|
348
|
-
enumValues:
|
|
1488
|
+
enumValues: undefined;
|
|
349
1489
|
baseColumn: never;
|
|
350
1490
|
identity: undefined;
|
|
351
1491
|
generated: undefined;
|
|
352
1492
|
}, {}, {}>;
|
|
353
|
-
|
|
354
|
-
name: "
|
|
355
|
-
tableName: "
|
|
1493
|
+
displayName: drizzle_orm_pg_core.PgColumn<{
|
|
1494
|
+
name: "display_name";
|
|
1495
|
+
tableName: "items";
|
|
356
1496
|
dataType: "string";
|
|
357
1497
|
columnType: "PgText";
|
|
358
1498
|
data: string;
|
|
359
1499
|
driverParam: string;
|
|
360
|
-
notNull:
|
|
1500
|
+
notNull: true;
|
|
361
1501
|
hasDefault: false;
|
|
362
1502
|
isPrimaryKey: false;
|
|
363
1503
|
isAutoincrement: false;
|
|
@@ -367,9 +1507,9 @@ declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
367
1507
|
identity: undefined;
|
|
368
1508
|
generated: undefined;
|
|
369
1509
|
}, {}, {}>;
|
|
370
|
-
|
|
371
|
-
name: "
|
|
372
|
-
tableName: "
|
|
1510
|
+
description: drizzle_orm_pg_core.PgColumn<{
|
|
1511
|
+
name: "description";
|
|
1512
|
+
tableName: "items";
|
|
373
1513
|
dataType: "string";
|
|
374
1514
|
columnType: "PgText";
|
|
375
1515
|
data: string;
|
|
@@ -384,28 +1524,45 @@ declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
384
1524
|
identity: undefined;
|
|
385
1525
|
generated: undefined;
|
|
386
1526
|
}, {}, {}>;
|
|
387
|
-
|
|
388
|
-
name: "
|
|
389
|
-
tableName: "
|
|
1527
|
+
type: drizzle_orm_pg_core.PgColumn<{
|
|
1528
|
+
name: "type";
|
|
1529
|
+
tableName: "items";
|
|
390
1530
|
dataType: "string";
|
|
391
1531
|
columnType: "PgEnumColumn";
|
|
392
|
-
data: "
|
|
1532
|
+
data: "accessory" | "badge" | "collectible" | "consumable" | "currency" | "other" | "trophy" | "unlock" | "upgrade";
|
|
393
1533
|
driverParam: string;
|
|
394
1534
|
notNull: true;
|
|
395
1535
|
hasDefault: true;
|
|
396
1536
|
isPrimaryKey: false;
|
|
397
1537
|
isAutoincrement: false;
|
|
398
1538
|
hasRuntimeDefault: false;
|
|
399
|
-
enumValues: ["
|
|
1539
|
+
enumValues: ["currency", "badge", "trophy", "collectible", "consumable", "unlock", "upgrade", "accessory", "other"];
|
|
400
1540
|
baseColumn: never;
|
|
401
1541
|
identity: undefined;
|
|
402
1542
|
generated: undefined;
|
|
403
1543
|
}, {}, {}>;
|
|
404
|
-
|
|
405
|
-
name: "
|
|
406
|
-
tableName: "
|
|
1544
|
+
isPlaceable: drizzle_orm_pg_core.PgColumn<{
|
|
1545
|
+
name: "is_placeable";
|
|
1546
|
+
tableName: "items";
|
|
1547
|
+
dataType: "boolean";
|
|
1548
|
+
columnType: "PgBoolean";
|
|
1549
|
+
data: boolean;
|
|
1550
|
+
driverParam: boolean;
|
|
1551
|
+
notNull: true;
|
|
1552
|
+
hasDefault: true;
|
|
1553
|
+
isPrimaryKey: false;
|
|
1554
|
+
isAutoincrement: false;
|
|
1555
|
+
hasRuntimeDefault: false;
|
|
1556
|
+
enumValues: undefined;
|
|
1557
|
+
baseColumn: never;
|
|
1558
|
+
identity: undefined;
|
|
1559
|
+
generated: undefined;
|
|
1560
|
+
}, {}, {}>;
|
|
1561
|
+
imageUrl: drizzle_orm_pg_core.PgColumn<{
|
|
1562
|
+
name: "image_url";
|
|
1563
|
+
tableName: "items";
|
|
407
1564
|
dataType: "string";
|
|
408
|
-
columnType: "
|
|
1565
|
+
columnType: "PgText";
|
|
409
1566
|
data: string;
|
|
410
1567
|
driverParam: string;
|
|
411
1568
|
notNull: false;
|
|
@@ -413,37 +1570,18 @@ declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
413
1570
|
isPrimaryKey: false;
|
|
414
1571
|
isAutoincrement: false;
|
|
415
1572
|
hasRuntimeDefault: false;
|
|
416
|
-
enumValues:
|
|
1573
|
+
enumValues: [string, ...string[]];
|
|
417
1574
|
baseColumn: never;
|
|
418
1575
|
identity: undefined;
|
|
419
1576
|
generated: undefined;
|
|
420
1577
|
}, {}, {}>;
|
|
421
1578
|
metadata: drizzle_orm_pg_core.PgColumn<{
|
|
422
1579
|
name: "metadata";
|
|
423
|
-
tableName: "
|
|
1580
|
+
tableName: "items";
|
|
424
1581
|
dataType: "json";
|
|
425
1582
|
columnType: "PgJsonb";
|
|
426
|
-
data:
|
|
1583
|
+
data: unknown;
|
|
427
1584
|
driverParam: unknown;
|
|
428
|
-
notNull: true;
|
|
429
|
-
hasDefault: true;
|
|
430
|
-
isPrimaryKey: false;
|
|
431
|
-
isAutoincrement: false;
|
|
432
|
-
hasRuntimeDefault: false;
|
|
433
|
-
enumValues: undefined;
|
|
434
|
-
baseColumn: never;
|
|
435
|
-
identity: undefined;
|
|
436
|
-
generated: undefined;
|
|
437
|
-
}, {}, {
|
|
438
|
-
$type: GameMetadata;
|
|
439
|
-
}>;
|
|
440
|
-
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
441
|
-
name: "created_at";
|
|
442
|
-
tableName: "games";
|
|
443
|
-
dataType: "date";
|
|
444
|
-
columnType: "PgTimestamp";
|
|
445
|
-
data: Date;
|
|
446
|
-
driverParam: string;
|
|
447
1585
|
notNull: false;
|
|
448
1586
|
hasDefault: true;
|
|
449
1587
|
isPrimaryKey: false;
|
|
@@ -454,14 +1592,14 @@ declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
454
1592
|
identity: undefined;
|
|
455
1593
|
generated: undefined;
|
|
456
1594
|
}, {}, {}>;
|
|
457
|
-
|
|
458
|
-
name: "
|
|
459
|
-
tableName: "
|
|
1595
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
1596
|
+
name: "created_at";
|
|
1597
|
+
tableName: "items";
|
|
460
1598
|
dataType: "date";
|
|
461
1599
|
columnType: "PgTimestamp";
|
|
462
1600
|
data: Date;
|
|
463
1601
|
driverParam: string;
|
|
464
|
-
notNull:
|
|
1602
|
+
notNull: true;
|
|
465
1603
|
hasDefault: true;
|
|
466
1604
|
isPrimaryKey: false;
|
|
467
1605
|
isAutoincrement: false;
|
|
@@ -474,13 +1612,13 @@ declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
474
1612
|
};
|
|
475
1613
|
dialect: "pg";
|
|
476
1614
|
}>;
|
|
477
|
-
declare const
|
|
478
|
-
name: "
|
|
1615
|
+
declare const inventoryItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
1616
|
+
name: "inventory_items";
|
|
479
1617
|
schema: undefined;
|
|
480
1618
|
columns: {
|
|
481
1619
|
id: drizzle_orm_pg_core.PgColumn<{
|
|
482
1620
|
name: "id";
|
|
483
|
-
tableName: "
|
|
1621
|
+
tableName: "inventory_items";
|
|
484
1622
|
dataType: "string";
|
|
485
1623
|
columnType: "PgUUID";
|
|
486
1624
|
data: string;
|
|
@@ -497,7 +1635,7 @@ declare const gameSessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
497
1635
|
}, {}, {}>;
|
|
498
1636
|
userId: drizzle_orm_pg_core.PgColumn<{
|
|
499
1637
|
name: "user_id";
|
|
500
|
-
tableName: "
|
|
1638
|
+
tableName: "inventory_items";
|
|
501
1639
|
dataType: "string";
|
|
502
1640
|
columnType: "PgText";
|
|
503
1641
|
data: string;
|
|
@@ -512,9 +1650,9 @@ declare const gameSessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
512
1650
|
identity: undefined;
|
|
513
1651
|
generated: undefined;
|
|
514
1652
|
}, {}, {}>;
|
|
515
|
-
|
|
516
|
-
name: "
|
|
517
|
-
tableName: "
|
|
1653
|
+
itemId: drizzle_orm_pg_core.PgColumn<{
|
|
1654
|
+
name: "item_id";
|
|
1655
|
+
tableName: "inventory_items";
|
|
518
1656
|
dataType: "string";
|
|
519
1657
|
columnType: "PgUUID";
|
|
520
1658
|
data: string;
|
|
@@ -529,13 +1667,13 @@ declare const gameSessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
529
1667
|
identity: undefined;
|
|
530
1668
|
generated: undefined;
|
|
531
1669
|
}, {}, {}>;
|
|
532
|
-
|
|
533
|
-
name: "
|
|
534
|
-
tableName: "
|
|
535
|
-
dataType: "
|
|
536
|
-
columnType: "
|
|
537
|
-
data:
|
|
538
|
-
driverParam: string;
|
|
1670
|
+
quantity: drizzle_orm_pg_core.PgColumn<{
|
|
1671
|
+
name: "quantity";
|
|
1672
|
+
tableName: "inventory_items";
|
|
1673
|
+
dataType: "number";
|
|
1674
|
+
columnType: "PgInteger";
|
|
1675
|
+
data: number;
|
|
1676
|
+
driverParam: string | number;
|
|
539
1677
|
notNull: true;
|
|
540
1678
|
hasDefault: true;
|
|
541
1679
|
isPrimaryKey: false;
|
|
@@ -546,15 +1684,15 @@ declare const gameSessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
546
1684
|
identity: undefined;
|
|
547
1685
|
generated: undefined;
|
|
548
1686
|
}, {}, {}>;
|
|
549
|
-
|
|
550
|
-
name: "
|
|
551
|
-
tableName: "
|
|
1687
|
+
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
1688
|
+
name: "updated_at";
|
|
1689
|
+
tableName: "inventory_items";
|
|
552
1690
|
dataType: "date";
|
|
553
1691
|
columnType: "PgTimestamp";
|
|
554
1692
|
data: Date;
|
|
555
1693
|
driverParam: string;
|
|
556
1694
|
notNull: false;
|
|
557
|
-
hasDefault:
|
|
1695
|
+
hasDefault: true;
|
|
558
1696
|
isPrimaryKey: false;
|
|
559
1697
|
isAutoincrement: false;
|
|
560
1698
|
hasRuntimeDefault: false;
|
|
@@ -566,13 +1704,13 @@ declare const gameSessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
566
1704
|
};
|
|
567
1705
|
dialect: "pg";
|
|
568
1706
|
}>;
|
|
569
|
-
declare const
|
|
570
|
-
name: "
|
|
1707
|
+
declare const currencies: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
1708
|
+
name: "currencies";
|
|
571
1709
|
schema: undefined;
|
|
572
1710
|
columns: {
|
|
573
1711
|
id: drizzle_orm_pg_core.PgColumn<{
|
|
574
1712
|
name: "id";
|
|
575
|
-
tableName: "
|
|
1713
|
+
tableName: "currencies";
|
|
576
1714
|
dataType: "string";
|
|
577
1715
|
columnType: "PgUUID";
|
|
578
1716
|
data: string;
|
|
@@ -587,60 +1725,26 @@ declare const items: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
587
1725
|
identity: undefined;
|
|
588
1726
|
generated: undefined;
|
|
589
1727
|
}, {}, {}>;
|
|
590
|
-
|
|
591
|
-
name: "
|
|
592
|
-
tableName: "
|
|
593
|
-
dataType: "string";
|
|
594
|
-
columnType: "PgText";
|
|
595
|
-
data: string;
|
|
596
|
-
driverParam: string;
|
|
597
|
-
notNull: true;
|
|
598
|
-
hasDefault: false;
|
|
599
|
-
isPrimaryKey: false;
|
|
600
|
-
isAutoincrement: false;
|
|
601
|
-
hasRuntimeDefault: false;
|
|
602
|
-
enumValues: [string, ...string[]];
|
|
603
|
-
baseColumn: never;
|
|
604
|
-
identity: undefined;
|
|
605
|
-
generated: undefined;
|
|
606
|
-
}, {}, {}>;
|
|
607
|
-
gameId: drizzle_orm_pg_core.PgColumn<{
|
|
608
|
-
name: "game_id";
|
|
609
|
-
tableName: "items";
|
|
1728
|
+
itemId: drizzle_orm_pg_core.PgColumn<{
|
|
1729
|
+
name: "item_id";
|
|
1730
|
+
tableName: "currencies";
|
|
610
1731
|
dataType: "string";
|
|
611
1732
|
columnType: "PgUUID";
|
|
612
1733
|
data: string;
|
|
613
1734
|
driverParam: string;
|
|
614
|
-
notNull: false;
|
|
615
|
-
hasDefault: false;
|
|
616
|
-
isPrimaryKey: false;
|
|
617
|
-
isAutoincrement: false;
|
|
618
|
-
hasRuntimeDefault: false;
|
|
619
|
-
enumValues: undefined;
|
|
620
|
-
baseColumn: never;
|
|
621
|
-
identity: undefined;
|
|
622
|
-
generated: undefined;
|
|
623
|
-
}, {}, {}>;
|
|
624
|
-
displayName: drizzle_orm_pg_core.PgColumn<{
|
|
625
|
-
name: "display_name";
|
|
626
|
-
tableName: "items";
|
|
627
|
-
dataType: "string";
|
|
628
|
-
columnType: "PgText";
|
|
629
|
-
data: string;
|
|
630
|
-
driverParam: string;
|
|
631
1735
|
notNull: true;
|
|
632
1736
|
hasDefault: false;
|
|
633
1737
|
isPrimaryKey: false;
|
|
634
1738
|
isAutoincrement: false;
|
|
635
1739
|
hasRuntimeDefault: false;
|
|
636
|
-
enumValues:
|
|
1740
|
+
enumValues: undefined;
|
|
637
1741
|
baseColumn: never;
|
|
638
1742
|
identity: undefined;
|
|
639
1743
|
generated: undefined;
|
|
640
1744
|
}, {}, {}>;
|
|
641
|
-
|
|
642
|
-
name: "
|
|
643
|
-
tableName: "
|
|
1745
|
+
symbol: drizzle_orm_pg_core.PgColumn<{
|
|
1746
|
+
name: "symbol";
|
|
1747
|
+
tableName: "currencies";
|
|
644
1748
|
dataType: "string";
|
|
645
1749
|
columnType: "PgText";
|
|
646
1750
|
data: string;
|
|
@@ -655,26 +1759,9 @@ declare const items: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
655
1759
|
identity: undefined;
|
|
656
1760
|
generated: undefined;
|
|
657
1761
|
}, {}, {}>;
|
|
658
|
-
|
|
659
|
-
name: "
|
|
660
|
-
tableName: "
|
|
661
|
-
dataType: "string";
|
|
662
|
-
columnType: "PgEnumColumn";
|
|
663
|
-
data: "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "accessory" | "other";
|
|
664
|
-
driverParam: string;
|
|
665
|
-
notNull: true;
|
|
666
|
-
hasDefault: true;
|
|
667
|
-
isPrimaryKey: false;
|
|
668
|
-
isAutoincrement: false;
|
|
669
|
-
hasRuntimeDefault: false;
|
|
670
|
-
enumValues: ["currency", "badge", "trophy", "collectible", "consumable", "unlock", "upgrade", "accessory", "other"];
|
|
671
|
-
baseColumn: never;
|
|
672
|
-
identity: undefined;
|
|
673
|
-
generated: undefined;
|
|
674
|
-
}, {}, {}>;
|
|
675
|
-
isPlaceable: drizzle_orm_pg_core.PgColumn<{
|
|
676
|
-
name: "is_placeable";
|
|
677
|
-
tableName: "items";
|
|
1762
|
+
isPrimary: drizzle_orm_pg_core.PgColumn<{
|
|
1763
|
+
name: "is_primary";
|
|
1764
|
+
tableName: "currencies";
|
|
678
1765
|
dataType: "boolean";
|
|
679
1766
|
columnType: "PgBoolean";
|
|
680
1767
|
data: boolean;
|
|
@@ -689,31 +1776,14 @@ declare const items: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
689
1776
|
identity: undefined;
|
|
690
1777
|
generated: undefined;
|
|
691
1778
|
}, {}, {}>;
|
|
692
|
-
|
|
693
|
-
name: "
|
|
694
|
-
tableName: "
|
|
695
|
-
dataType: "
|
|
696
|
-
columnType: "
|
|
697
|
-
data:
|
|
1779
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
1780
|
+
name: "created_at";
|
|
1781
|
+
tableName: "currencies";
|
|
1782
|
+
dataType: "date";
|
|
1783
|
+
columnType: "PgTimestamp";
|
|
1784
|
+
data: Date;
|
|
698
1785
|
driverParam: string;
|
|
699
|
-
notNull:
|
|
700
|
-
hasDefault: false;
|
|
701
|
-
isPrimaryKey: false;
|
|
702
|
-
isAutoincrement: false;
|
|
703
|
-
hasRuntimeDefault: false;
|
|
704
|
-
enumValues: [string, ...string[]];
|
|
705
|
-
baseColumn: never;
|
|
706
|
-
identity: undefined;
|
|
707
|
-
generated: undefined;
|
|
708
|
-
}, {}, {}>;
|
|
709
|
-
metadata: drizzle_orm_pg_core.PgColumn<{
|
|
710
|
-
name: "metadata";
|
|
711
|
-
tableName: "items";
|
|
712
|
-
dataType: "json";
|
|
713
|
-
columnType: "PgJsonb";
|
|
714
|
-
data: unknown;
|
|
715
|
-
driverParam: unknown;
|
|
716
|
-
notNull: false;
|
|
1786
|
+
notNull: true;
|
|
717
1787
|
hasDefault: true;
|
|
718
1788
|
isPrimaryKey: false;
|
|
719
1789
|
isAutoincrement: false;
|
|
@@ -722,15 +1792,15 @@ declare const items: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
722
1792
|
baseColumn: never;
|
|
723
1793
|
identity: undefined;
|
|
724
1794
|
generated: undefined;
|
|
725
|
-
}, {}, {}>;
|
|
726
|
-
|
|
727
|
-
name: "
|
|
728
|
-
tableName: "
|
|
1795
|
+
}, {}, {}>;
|
|
1796
|
+
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
1797
|
+
name: "updated_at";
|
|
1798
|
+
tableName: "currencies";
|
|
729
1799
|
dataType: "date";
|
|
730
1800
|
columnType: "PgTimestamp";
|
|
731
1801
|
data: Date;
|
|
732
1802
|
driverParam: string;
|
|
733
|
-
notNull:
|
|
1803
|
+
notNull: false;
|
|
734
1804
|
hasDefault: true;
|
|
735
1805
|
isPrimaryKey: false;
|
|
736
1806
|
isAutoincrement: false;
|
|
@@ -743,13 +1813,13 @@ declare const items: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
743
1813
|
};
|
|
744
1814
|
dialect: "pg";
|
|
745
1815
|
}>;
|
|
746
|
-
declare const
|
|
747
|
-
name: "
|
|
1816
|
+
declare const shopListings: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
1817
|
+
name: "shop_listings";
|
|
748
1818
|
schema: undefined;
|
|
749
1819
|
columns: {
|
|
750
1820
|
id: drizzle_orm_pg_core.PgColumn<{
|
|
751
1821
|
name: "id";
|
|
752
|
-
tableName: "
|
|
1822
|
+
tableName: "shop_listings";
|
|
753
1823
|
dataType: "string";
|
|
754
1824
|
columnType: "PgUUID";
|
|
755
1825
|
data: string;
|
|
@@ -764,11 +1834,11 @@ declare const inventoryItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
764
1834
|
identity: undefined;
|
|
765
1835
|
generated: undefined;
|
|
766
1836
|
}, {}, {}>;
|
|
767
|
-
|
|
768
|
-
name: "
|
|
769
|
-
tableName: "
|
|
1837
|
+
itemId: drizzle_orm_pg_core.PgColumn<{
|
|
1838
|
+
name: "item_id";
|
|
1839
|
+
tableName: "shop_listings";
|
|
770
1840
|
dataType: "string";
|
|
771
|
-
columnType: "
|
|
1841
|
+
columnType: "PgUUID";
|
|
772
1842
|
data: string;
|
|
773
1843
|
driverParam: string;
|
|
774
1844
|
notNull: true;
|
|
@@ -776,14 +1846,14 @@ declare const inventoryItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
776
1846
|
isPrimaryKey: false;
|
|
777
1847
|
isAutoincrement: false;
|
|
778
1848
|
hasRuntimeDefault: false;
|
|
779
|
-
enumValues:
|
|
1849
|
+
enumValues: undefined;
|
|
780
1850
|
baseColumn: never;
|
|
781
1851
|
identity: undefined;
|
|
782
1852
|
generated: undefined;
|
|
783
1853
|
}, {}, {}>;
|
|
784
|
-
|
|
785
|
-
name: "
|
|
786
|
-
tableName: "
|
|
1854
|
+
currencyId: drizzle_orm_pg_core.PgColumn<{
|
|
1855
|
+
name: "currency_id";
|
|
1856
|
+
tableName: "shop_listings";
|
|
787
1857
|
dataType: "string";
|
|
788
1858
|
columnType: "PgUUID";
|
|
789
1859
|
data: string;
|
|
@@ -798,15 +1868,15 @@ declare const inventoryItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
798
1868
|
identity: undefined;
|
|
799
1869
|
generated: undefined;
|
|
800
1870
|
}, {}, {}>;
|
|
801
|
-
|
|
802
|
-
name: "
|
|
803
|
-
tableName: "
|
|
1871
|
+
price: drizzle_orm_pg_core.PgColumn<{
|
|
1872
|
+
name: "price";
|
|
1873
|
+
tableName: "shop_listings";
|
|
804
1874
|
dataType: "number";
|
|
805
1875
|
columnType: "PgInteger";
|
|
806
1876
|
data: number;
|
|
807
1877
|
driverParam: string | number;
|
|
808
1878
|
notNull: true;
|
|
809
|
-
hasDefault:
|
|
1879
|
+
hasDefault: false;
|
|
810
1880
|
isPrimaryKey: false;
|
|
811
1881
|
isAutoincrement: false;
|
|
812
1882
|
hasRuntimeDefault: false;
|
|
@@ -815,15 +1885,15 @@ declare const inventoryItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
815
1885
|
identity: undefined;
|
|
816
1886
|
generated: undefined;
|
|
817
1887
|
}, {}, {}>;
|
|
818
|
-
|
|
819
|
-
name: "
|
|
820
|
-
tableName: "
|
|
821
|
-
dataType: "
|
|
822
|
-
columnType: "
|
|
823
|
-
data:
|
|
824
|
-
driverParam: string;
|
|
1888
|
+
sellBackPercentage: drizzle_orm_pg_core.PgColumn<{
|
|
1889
|
+
name: "sell_back_percentage";
|
|
1890
|
+
tableName: "shop_listings";
|
|
1891
|
+
dataType: "number";
|
|
1892
|
+
columnType: "PgInteger";
|
|
1893
|
+
data: number;
|
|
1894
|
+
driverParam: string | number;
|
|
825
1895
|
notNull: false;
|
|
826
|
-
hasDefault:
|
|
1896
|
+
hasDefault: false;
|
|
827
1897
|
isPrimaryKey: false;
|
|
828
1898
|
isAutoincrement: false;
|
|
829
1899
|
hasRuntimeDefault: false;
|
|
@@ -832,23 +1902,16 @@ declare const inventoryItems: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
832
1902
|
identity: undefined;
|
|
833
1903
|
generated: undefined;
|
|
834
1904
|
}, {}, {}>;
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
dataType: "string";
|
|
846
|
-
columnType: "PgUUID";
|
|
847
|
-
data: string;
|
|
848
|
-
driverParam: string;
|
|
849
|
-
notNull: true;
|
|
850
|
-
hasDefault: true;
|
|
851
|
-
isPrimaryKey: true;
|
|
1905
|
+
stock: drizzle_orm_pg_core.PgColumn<{
|
|
1906
|
+
name: "stock";
|
|
1907
|
+
tableName: "shop_listings";
|
|
1908
|
+
dataType: "number";
|
|
1909
|
+
columnType: "PgInteger";
|
|
1910
|
+
data: number;
|
|
1911
|
+
driverParam: string | number;
|
|
1912
|
+
notNull: false;
|
|
1913
|
+
hasDefault: false;
|
|
1914
|
+
isPrimaryKey: false;
|
|
852
1915
|
isAutoincrement: false;
|
|
853
1916
|
hasRuntimeDefault: false;
|
|
854
1917
|
enumValues: undefined;
|
|
@@ -856,15 +1919,15 @@ declare const currencies: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
856
1919
|
identity: undefined;
|
|
857
1920
|
generated: undefined;
|
|
858
1921
|
}, {}, {}>;
|
|
859
|
-
|
|
860
|
-
name: "
|
|
861
|
-
tableName: "
|
|
862
|
-
dataType: "
|
|
863
|
-
columnType: "
|
|
864
|
-
data:
|
|
865
|
-
driverParam:
|
|
1922
|
+
isActive: drizzle_orm_pg_core.PgColumn<{
|
|
1923
|
+
name: "is_active";
|
|
1924
|
+
tableName: "shop_listings";
|
|
1925
|
+
dataType: "boolean";
|
|
1926
|
+
columnType: "PgBoolean";
|
|
1927
|
+
data: boolean;
|
|
1928
|
+
driverParam: boolean;
|
|
866
1929
|
notNull: true;
|
|
867
|
-
hasDefault:
|
|
1930
|
+
hasDefault: true;
|
|
868
1931
|
isPrimaryKey: false;
|
|
869
1932
|
isAutoincrement: false;
|
|
870
1933
|
hasRuntimeDefault: false;
|
|
@@ -873,32 +1936,32 @@ declare const currencies: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
873
1936
|
identity: undefined;
|
|
874
1937
|
generated: undefined;
|
|
875
1938
|
}, {}, {}>;
|
|
876
|
-
|
|
877
|
-
name: "
|
|
878
|
-
tableName: "
|
|
879
|
-
dataType: "
|
|
880
|
-
columnType: "
|
|
881
|
-
data:
|
|
1939
|
+
availableFrom: drizzle_orm_pg_core.PgColumn<{
|
|
1940
|
+
name: "available_from";
|
|
1941
|
+
tableName: "shop_listings";
|
|
1942
|
+
dataType: "date";
|
|
1943
|
+
columnType: "PgTimestamp";
|
|
1944
|
+
data: Date;
|
|
882
1945
|
driverParam: string;
|
|
883
1946
|
notNull: false;
|
|
884
1947
|
hasDefault: false;
|
|
885
1948
|
isPrimaryKey: false;
|
|
886
1949
|
isAutoincrement: false;
|
|
887
1950
|
hasRuntimeDefault: false;
|
|
888
|
-
enumValues:
|
|
1951
|
+
enumValues: undefined;
|
|
889
1952
|
baseColumn: never;
|
|
890
1953
|
identity: undefined;
|
|
891
1954
|
generated: undefined;
|
|
892
1955
|
}, {}, {}>;
|
|
893
|
-
|
|
894
|
-
name: "
|
|
895
|
-
tableName: "
|
|
896
|
-
dataType: "
|
|
897
|
-
columnType: "
|
|
898
|
-
data:
|
|
899
|
-
driverParam:
|
|
900
|
-
notNull:
|
|
901
|
-
hasDefault:
|
|
1956
|
+
availableUntil: drizzle_orm_pg_core.PgColumn<{
|
|
1957
|
+
name: "available_until";
|
|
1958
|
+
tableName: "shop_listings";
|
|
1959
|
+
dataType: "date";
|
|
1960
|
+
columnType: "PgTimestamp";
|
|
1961
|
+
data: Date;
|
|
1962
|
+
driverParam: string;
|
|
1963
|
+
notNull: false;
|
|
1964
|
+
hasDefault: false;
|
|
902
1965
|
isPrimaryKey: false;
|
|
903
1966
|
isAutoincrement: false;
|
|
904
1967
|
hasRuntimeDefault: false;
|
|
@@ -909,7 +1972,7 @@ declare const currencies: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
909
1972
|
}, {}, {}>;
|
|
910
1973
|
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
911
1974
|
name: "created_at";
|
|
912
|
-
tableName: "
|
|
1975
|
+
tableName: "shop_listings";
|
|
913
1976
|
dataType: "date";
|
|
914
1977
|
columnType: "PgTimestamp";
|
|
915
1978
|
data: Date;
|
|
@@ -926,7 +1989,7 @@ declare const currencies: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
926
1989
|
}, {}, {}>;
|
|
927
1990
|
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
928
1991
|
name: "updated_at";
|
|
929
|
-
tableName: "
|
|
1992
|
+
tableName: "shop_listings";
|
|
930
1993
|
dataType: "date";
|
|
931
1994
|
columnType: "PgTimestamp";
|
|
932
1995
|
data: Date;
|
|
@@ -1157,7 +2220,7 @@ declare const mapElements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
1157
2220
|
tableName: "map_elements";
|
|
1158
2221
|
dataType: "string";
|
|
1159
2222
|
columnType: "PgEnumColumn";
|
|
1160
|
-
data: "
|
|
2223
|
+
data: "door_in" | "door_out" | "game_entry" | "game_registry" | "info" | "npc_interaction" | "quest_trigger" | "teleport";
|
|
1161
2224
|
driverParam: string;
|
|
1162
2225
|
notNull: true;
|
|
1163
2226
|
hasDefault: false;
|
|
@@ -1710,7 +2773,7 @@ declare const characterComponents: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
1710
2773
|
tableName: "character_components";
|
|
1711
2774
|
dataType: "string";
|
|
1712
2775
|
columnType: "PgEnumColumn";
|
|
1713
|
-
data: "accessory" | "body" | "
|
|
2776
|
+
data: "accessory" | "body" | "eyes" | "hairstyle" | "outfit";
|
|
1714
2777
|
driverParam: string;
|
|
1715
2778
|
notNull: true;
|
|
1716
2779
|
hasDefault: false;
|
|
@@ -2121,22 +3184,54 @@ declare const playerCharacterAccessories: drizzle_orm_pg_core.PgTableWithColumns
|
|
|
2121
3184
|
};
|
|
2122
3185
|
dialect: "pg";
|
|
2123
3186
|
}>;
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
2127
|
-
name: "achievements";
|
|
3187
|
+
declare const notifications: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
3188
|
+
name: "notifications";
|
|
2128
3189
|
schema: undefined;
|
|
2129
3190
|
columns: {
|
|
2130
3191
|
id: drizzle_orm_pg_core.PgColumn<{
|
|
2131
3192
|
name: "id";
|
|
2132
|
-
tableName: "
|
|
3193
|
+
tableName: "notifications";
|
|
3194
|
+
dataType: "string";
|
|
3195
|
+
columnType: "PgUUID";
|
|
3196
|
+
data: string;
|
|
3197
|
+
driverParam: string;
|
|
3198
|
+
notNull: true;
|
|
3199
|
+
hasDefault: true;
|
|
3200
|
+
isPrimaryKey: true;
|
|
3201
|
+
isAutoincrement: false;
|
|
3202
|
+
hasRuntimeDefault: false;
|
|
3203
|
+
enumValues: undefined;
|
|
3204
|
+
baseColumn: never;
|
|
3205
|
+
identity: undefined;
|
|
3206
|
+
generated: undefined;
|
|
3207
|
+
}, {}, {}>;
|
|
3208
|
+
userId: drizzle_orm_pg_core.PgColumn<{
|
|
3209
|
+
name: "user_id";
|
|
3210
|
+
tableName: "notifications";
|
|
3211
|
+
dataType: "string";
|
|
3212
|
+
columnType: "PgText";
|
|
3213
|
+
data: string;
|
|
3214
|
+
driverParam: string;
|
|
3215
|
+
notNull: true;
|
|
3216
|
+
hasDefault: false;
|
|
3217
|
+
isPrimaryKey: false;
|
|
3218
|
+
isAutoincrement: false;
|
|
3219
|
+
hasRuntimeDefault: false;
|
|
3220
|
+
enumValues: [string, ...string[]];
|
|
3221
|
+
baseColumn: never;
|
|
3222
|
+
identity: undefined;
|
|
3223
|
+
generated: undefined;
|
|
3224
|
+
}, {}, {}>;
|
|
3225
|
+
type: drizzle_orm_pg_core.PgColumn<{
|
|
3226
|
+
name: "type";
|
|
3227
|
+
tableName: "notifications";
|
|
2133
3228
|
dataType: "string";
|
|
2134
3229
|
columnType: "PgVarchar";
|
|
2135
3230
|
data: string;
|
|
2136
3231
|
driverParam: string;
|
|
2137
3232
|
notNull: true;
|
|
2138
3233
|
hasDefault: false;
|
|
2139
|
-
isPrimaryKey:
|
|
3234
|
+
isPrimaryKey: false;
|
|
2140
3235
|
isAutoincrement: false;
|
|
2141
3236
|
hasRuntimeDefault: false;
|
|
2142
3237
|
enumValues: [string, ...string[]];
|
|
@@ -2144,11 +3239,11 @@ declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2144
3239
|
identity: undefined;
|
|
2145
3240
|
generated: undefined;
|
|
2146
3241
|
}, {}, {
|
|
2147
|
-
length:
|
|
3242
|
+
length: 50;
|
|
2148
3243
|
}>;
|
|
2149
3244
|
title: drizzle_orm_pg_core.PgColumn<{
|
|
2150
3245
|
name: "title";
|
|
2151
|
-
tableName: "
|
|
3246
|
+
tableName: "notifications";
|
|
2152
3247
|
dataType: "string";
|
|
2153
3248
|
columnType: "PgVarchar";
|
|
2154
3249
|
data: string;
|
|
@@ -2165,14 +3260,14 @@ declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2165
3260
|
}, {}, {
|
|
2166
3261
|
length: 255;
|
|
2167
3262
|
}>;
|
|
2168
|
-
|
|
2169
|
-
name: "
|
|
2170
|
-
tableName: "
|
|
3263
|
+
message: drizzle_orm_pg_core.PgColumn<{
|
|
3264
|
+
name: "message";
|
|
3265
|
+
tableName: "notifications";
|
|
2171
3266
|
dataType: "string";
|
|
2172
3267
|
columnType: "PgText";
|
|
2173
3268
|
data: string;
|
|
2174
3269
|
driverParam: string;
|
|
2175
|
-
notNull:
|
|
3270
|
+
notNull: true;
|
|
2176
3271
|
hasDefault: false;
|
|
2177
3272
|
isPrimaryKey: false;
|
|
2178
3273
|
isAutoincrement: false;
|
|
@@ -2182,85 +3277,83 @@ declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2182
3277
|
identity: undefined;
|
|
2183
3278
|
generated: undefined;
|
|
2184
3279
|
}, {}, {}>;
|
|
2185
|
-
|
|
2186
|
-
name: "
|
|
2187
|
-
tableName: "
|
|
2188
|
-
dataType: "
|
|
2189
|
-
columnType: "
|
|
2190
|
-
data:
|
|
2191
|
-
driverParam:
|
|
3280
|
+
data: drizzle_orm_pg_core.PgColumn<{
|
|
3281
|
+
name: "data";
|
|
3282
|
+
tableName: "notifications";
|
|
3283
|
+
dataType: "json";
|
|
3284
|
+
columnType: "PgJsonb";
|
|
3285
|
+
data: unknown;
|
|
3286
|
+
driverParam: unknown;
|
|
2192
3287
|
notNull: true;
|
|
2193
|
-
hasDefault:
|
|
3288
|
+
hasDefault: true;
|
|
2194
3289
|
isPrimaryKey: false;
|
|
2195
3290
|
isAutoincrement: false;
|
|
2196
3291
|
hasRuntimeDefault: false;
|
|
2197
|
-
enumValues:
|
|
3292
|
+
enumValues: undefined;
|
|
2198
3293
|
baseColumn: never;
|
|
2199
3294
|
identity: undefined;
|
|
2200
3295
|
generated: undefined;
|
|
2201
3296
|
}, {}, {}>;
|
|
2202
|
-
|
|
2203
|
-
name: "
|
|
2204
|
-
tableName: "
|
|
2205
|
-
dataType: "
|
|
2206
|
-
columnType: "
|
|
2207
|
-
data:
|
|
2208
|
-
driverParam: string
|
|
3297
|
+
priority: drizzle_orm_pg_core.PgColumn<{
|
|
3298
|
+
name: "priority";
|
|
3299
|
+
tableName: "notifications";
|
|
3300
|
+
dataType: "string";
|
|
3301
|
+
columnType: "PgEnumColumn";
|
|
3302
|
+
data: "high" | "low" | "normal" | "urgent";
|
|
3303
|
+
driverParam: string;
|
|
2209
3304
|
notNull: true;
|
|
2210
3305
|
hasDefault: true;
|
|
2211
3306
|
isPrimaryKey: false;
|
|
2212
3307
|
isAutoincrement: false;
|
|
2213
3308
|
hasRuntimeDefault: false;
|
|
2214
|
-
enumValues:
|
|
3309
|
+
enumValues: ["low", "normal", "high", "urgent"];
|
|
2215
3310
|
baseColumn: never;
|
|
2216
3311
|
identity: undefined;
|
|
2217
3312
|
generated: undefined;
|
|
2218
3313
|
}, {}, {}>;
|
|
2219
|
-
|
|
2220
|
-
name: "
|
|
2221
|
-
tableName: "
|
|
2222
|
-
dataType: "
|
|
2223
|
-
columnType: "
|
|
2224
|
-
data:
|
|
2225
|
-
driverParam: string
|
|
3314
|
+
status: drizzle_orm_pg_core.PgColumn<{
|
|
3315
|
+
name: "status";
|
|
3316
|
+
tableName: "notifications";
|
|
3317
|
+
dataType: "string";
|
|
3318
|
+
columnType: "PgEnumColumn";
|
|
3319
|
+
data: "clicked" | "delivered" | "dismissed" | "expired" | "pending" | "seen";
|
|
3320
|
+
driverParam: string;
|
|
2226
3321
|
notNull: true;
|
|
2227
3322
|
hasDefault: true;
|
|
2228
3323
|
isPrimaryKey: false;
|
|
2229
3324
|
isAutoincrement: false;
|
|
2230
3325
|
hasRuntimeDefault: false;
|
|
2231
|
-
enumValues:
|
|
3326
|
+
enumValues: ["pending", "delivered", "seen", "clicked", "dismissed", "expired"];
|
|
2232
3327
|
baseColumn: never;
|
|
2233
3328
|
identity: undefined;
|
|
2234
3329
|
generated: undefined;
|
|
2235
3330
|
}, {}, {}>;
|
|
2236
|
-
|
|
2237
|
-
name: "
|
|
2238
|
-
tableName: "
|
|
2239
|
-
dataType: "
|
|
2240
|
-
columnType: "
|
|
2241
|
-
data:
|
|
3331
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
3332
|
+
name: "created_at";
|
|
3333
|
+
tableName: "notifications";
|
|
3334
|
+
dataType: "date";
|
|
3335
|
+
columnType: "PgTimestamp";
|
|
3336
|
+
data: Date;
|
|
2242
3337
|
driverParam: string;
|
|
2243
3338
|
notNull: true;
|
|
2244
|
-
hasDefault:
|
|
3339
|
+
hasDefault: true;
|
|
2245
3340
|
isPrimaryKey: false;
|
|
2246
3341
|
isAutoincrement: false;
|
|
2247
3342
|
hasRuntimeDefault: false;
|
|
2248
|
-
enumValues:
|
|
3343
|
+
enumValues: undefined;
|
|
2249
3344
|
baseColumn: never;
|
|
2250
3345
|
identity: undefined;
|
|
2251
3346
|
generated: undefined;
|
|
2252
|
-
}, {}, {
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
notNull: true;
|
|
2263
|
-
hasDefault: true;
|
|
3347
|
+
}, {}, {}>;
|
|
3348
|
+
deliveredAt: drizzle_orm_pg_core.PgColumn<{
|
|
3349
|
+
name: "delivered_at";
|
|
3350
|
+
tableName: "notifications";
|
|
3351
|
+
dataType: "date";
|
|
3352
|
+
columnType: "PgTimestamp";
|
|
3353
|
+
data: Date;
|
|
3354
|
+
driverParam: string;
|
|
3355
|
+
notNull: false;
|
|
3356
|
+
hasDefault: false;
|
|
2264
3357
|
isPrimaryKey: false;
|
|
2265
3358
|
isAutoincrement: false;
|
|
2266
3359
|
hasRuntimeDefault: false;
|
|
@@ -2269,15 +3362,15 @@ declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2269
3362
|
identity: undefined;
|
|
2270
3363
|
generated: undefined;
|
|
2271
3364
|
}, {}, {}>;
|
|
2272
|
-
|
|
2273
|
-
name: "
|
|
2274
|
-
tableName: "
|
|
2275
|
-
dataType: "
|
|
2276
|
-
columnType: "
|
|
2277
|
-
data:
|
|
2278
|
-
driverParam:
|
|
2279
|
-
notNull:
|
|
2280
|
-
hasDefault:
|
|
3365
|
+
seenAt: drizzle_orm_pg_core.PgColumn<{
|
|
3366
|
+
name: "seen_at";
|
|
3367
|
+
tableName: "notifications";
|
|
3368
|
+
dataType: "date";
|
|
3369
|
+
columnType: "PgTimestamp";
|
|
3370
|
+
data: Date;
|
|
3371
|
+
driverParam: string;
|
|
3372
|
+
notNull: false;
|
|
3373
|
+
hasDefault: false;
|
|
2281
3374
|
isPrimaryKey: false;
|
|
2282
3375
|
isAutoincrement: false;
|
|
2283
3376
|
hasRuntimeDefault: false;
|
|
@@ -2286,15 +3379,15 @@ declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2286
3379
|
identity: undefined;
|
|
2287
3380
|
generated: undefined;
|
|
2288
3381
|
}, {}, {}>;
|
|
2289
|
-
|
|
2290
|
-
name: "
|
|
2291
|
-
tableName: "
|
|
2292
|
-
dataType: "
|
|
2293
|
-
columnType: "
|
|
2294
|
-
data:
|
|
2295
|
-
driverParam:
|
|
2296
|
-
notNull:
|
|
2297
|
-
hasDefault:
|
|
3382
|
+
clickedAt: drizzle_orm_pg_core.PgColumn<{
|
|
3383
|
+
name: "clicked_at";
|
|
3384
|
+
tableName: "notifications";
|
|
3385
|
+
dataType: "date";
|
|
3386
|
+
columnType: "PgTimestamp";
|
|
3387
|
+
data: Date;
|
|
3388
|
+
driverParam: string;
|
|
3389
|
+
notNull: false;
|
|
3390
|
+
hasDefault: false;
|
|
2298
3391
|
isPrimaryKey: false;
|
|
2299
3392
|
isAutoincrement: false;
|
|
2300
3393
|
hasRuntimeDefault: false;
|
|
@@ -2303,15 +3396,15 @@ declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2303
3396
|
identity: undefined;
|
|
2304
3397
|
generated: undefined;
|
|
2305
3398
|
}, {}, {}>;
|
|
2306
|
-
|
|
2307
|
-
name: "
|
|
2308
|
-
tableName: "
|
|
3399
|
+
expiresAt: drizzle_orm_pg_core.PgColumn<{
|
|
3400
|
+
name: "expires_at";
|
|
3401
|
+
tableName: "notifications";
|
|
2309
3402
|
dataType: "date";
|
|
2310
3403
|
columnType: "PgTimestamp";
|
|
2311
3404
|
data: Date;
|
|
2312
3405
|
driverParam: string;
|
|
2313
3406
|
notNull: false;
|
|
2314
|
-
hasDefault:
|
|
3407
|
+
hasDefault: false;
|
|
2315
3408
|
isPrimaryKey: false;
|
|
2316
3409
|
isAutoincrement: false;
|
|
2317
3410
|
hasRuntimeDefault: false;
|
|
@@ -2320,14 +3413,50 @@ declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2320
3413
|
identity: undefined;
|
|
2321
3414
|
generated: undefined;
|
|
2322
3415
|
}, {}, {}>;
|
|
2323
|
-
|
|
2324
|
-
name: "
|
|
2325
|
-
tableName: "
|
|
2326
|
-
dataType: "
|
|
2327
|
-
columnType: "
|
|
2328
|
-
data:
|
|
2329
|
-
driverParam: string;
|
|
2330
|
-
notNull: false;
|
|
3416
|
+
method: drizzle_orm_pg_core.PgColumn<{
|
|
3417
|
+
name: "method";
|
|
3418
|
+
tableName: "notifications";
|
|
3419
|
+
dataType: "string";
|
|
3420
|
+
columnType: "PgVarchar";
|
|
3421
|
+
data: string;
|
|
3422
|
+
driverParam: string;
|
|
3423
|
+
notNull: false;
|
|
3424
|
+
hasDefault: false;
|
|
3425
|
+
isPrimaryKey: false;
|
|
3426
|
+
isAutoincrement: false;
|
|
3427
|
+
hasRuntimeDefault: false;
|
|
3428
|
+
enumValues: [string, ...string[]];
|
|
3429
|
+
baseColumn: never;
|
|
3430
|
+
identity: undefined;
|
|
3431
|
+
generated: undefined;
|
|
3432
|
+
}, {}, {
|
|
3433
|
+
length: 50;
|
|
3434
|
+
}>;
|
|
3435
|
+
clickUrl: drizzle_orm_pg_core.PgColumn<{
|
|
3436
|
+
name: "click_url";
|
|
3437
|
+
tableName: "notifications";
|
|
3438
|
+
dataType: "string";
|
|
3439
|
+
columnType: "PgText";
|
|
3440
|
+
data: string;
|
|
3441
|
+
driverParam: string;
|
|
3442
|
+
notNull: false;
|
|
3443
|
+
hasDefault: false;
|
|
3444
|
+
isPrimaryKey: false;
|
|
3445
|
+
isAutoincrement: false;
|
|
3446
|
+
hasRuntimeDefault: false;
|
|
3447
|
+
enumValues: [string, ...string[]];
|
|
3448
|
+
baseColumn: never;
|
|
3449
|
+
identity: undefined;
|
|
3450
|
+
generated: undefined;
|
|
3451
|
+
}, {}, {}>;
|
|
3452
|
+
metadata: drizzle_orm_pg_core.PgColumn<{
|
|
3453
|
+
name: "metadata";
|
|
3454
|
+
tableName: "notifications";
|
|
3455
|
+
dataType: "json";
|
|
3456
|
+
columnType: "PgJsonb";
|
|
3457
|
+
data: unknown;
|
|
3458
|
+
driverParam: unknown;
|
|
3459
|
+
notNull: true;
|
|
2331
3460
|
hasDefault: true;
|
|
2332
3461
|
isPrimaryKey: false;
|
|
2333
3462
|
isAutoincrement: false;
|
|
@@ -2340,88 +3469,600 @@ declare const achievements: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
2340
3469
|
};
|
|
2341
3470
|
dialect: "pg";
|
|
2342
3471
|
}>;
|
|
2343
|
-
declare const
|
|
2344
|
-
|
|
3472
|
+
declare const UpsertGameMetadataSchema: z.ZodEffects<z.ZodObject<{
|
|
3473
|
+
displayName: z.ZodString;
|
|
3474
|
+
mapElementId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
3475
|
+
platform: z.ZodEnum<["web", "godot", "unity"]>;
|
|
3476
|
+
metadata: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
3477
|
+
gameType: z.ZodDefault<z.ZodOptional<z.ZodEnum<["hosted", "external"]>>>;
|
|
3478
|
+
externalUrl: z.ZodOptional<z.ZodString>;
|
|
2345
3479
|
}, "strip", z.ZodTypeAny, {
|
|
2346
|
-
|
|
3480
|
+
displayName: string;
|
|
3481
|
+
mapElementId?: string | null | undefined;
|
|
3482
|
+
platform: "godot" | "unity" | "web";
|
|
3483
|
+
metadata: Record<string, unknown>;
|
|
3484
|
+
gameType: "external" | "hosted";
|
|
3485
|
+
externalUrl?: string | undefined;
|
|
3486
|
+
}, {
|
|
3487
|
+
displayName: string;
|
|
3488
|
+
mapElementId?: string | null | undefined;
|
|
3489
|
+
platform: "godot" | "unity" | "web";
|
|
3490
|
+
metadata?: Record<string, unknown> | undefined;
|
|
3491
|
+
gameType?: "external" | "hosted" | undefined;
|
|
3492
|
+
externalUrl?: string | undefined;
|
|
3493
|
+
}>, {
|
|
3494
|
+
displayName: string;
|
|
3495
|
+
mapElementId?: string | null | undefined;
|
|
3496
|
+
platform: "godot" | "unity" | "web";
|
|
3497
|
+
metadata: Record<string, unknown>;
|
|
3498
|
+
gameType: "external" | "hosted";
|
|
3499
|
+
externalUrl?: string | undefined;
|
|
2347
3500
|
}, {
|
|
2348
|
-
|
|
3501
|
+
displayName: string;
|
|
3502
|
+
mapElementId?: string | null | undefined;
|
|
3503
|
+
platform: "godot" | "unity" | "web";
|
|
3504
|
+
metadata?: Record<string, unknown> | undefined;
|
|
3505
|
+
gameType?: "external" | "hosted" | undefined;
|
|
3506
|
+
externalUrl?: string | undefined;
|
|
2349
3507
|
}>;
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
3508
|
+
|
|
3509
|
+
declare const InsertItemSchema: drizzle_zod.BuildSchema<"insert", {
|
|
3510
|
+
id: drizzle_orm_pg_core.PgColumn<{
|
|
3511
|
+
name: "id";
|
|
3512
|
+
tableName: "items";
|
|
3513
|
+
dataType: "string";
|
|
3514
|
+
columnType: "PgUUID";
|
|
3515
|
+
data: string;
|
|
3516
|
+
driverParam: string;
|
|
3517
|
+
notNull: true;
|
|
3518
|
+
hasDefault: true;
|
|
3519
|
+
isPrimaryKey: true;
|
|
3520
|
+
isAutoincrement: false;
|
|
3521
|
+
hasRuntimeDefault: false;
|
|
3522
|
+
enumValues: undefined;
|
|
3523
|
+
baseColumn: never;
|
|
3524
|
+
identity: undefined;
|
|
3525
|
+
generated: undefined;
|
|
3526
|
+
}, {}, {}>;
|
|
3527
|
+
slug: drizzle_orm_pg_core.PgColumn<{
|
|
3528
|
+
name: "slug";
|
|
3529
|
+
tableName: "items";
|
|
3530
|
+
dataType: "string";
|
|
3531
|
+
columnType: "PgText";
|
|
3532
|
+
data: string;
|
|
3533
|
+
driverParam: string;
|
|
3534
|
+
notNull: true;
|
|
3535
|
+
hasDefault: false;
|
|
3536
|
+
isPrimaryKey: false;
|
|
3537
|
+
isAutoincrement: false;
|
|
3538
|
+
hasRuntimeDefault: false;
|
|
3539
|
+
enumValues: [string, ...string[]];
|
|
3540
|
+
baseColumn: never;
|
|
3541
|
+
identity: undefined;
|
|
3542
|
+
generated: undefined;
|
|
3543
|
+
}, {}, {}>;
|
|
3544
|
+
gameId: drizzle_orm_pg_core.PgColumn<{
|
|
3545
|
+
name: "game_id";
|
|
3546
|
+
tableName: "items";
|
|
3547
|
+
dataType: "string";
|
|
3548
|
+
columnType: "PgUUID";
|
|
3549
|
+
data: string;
|
|
3550
|
+
driverParam: string;
|
|
3551
|
+
notNull: false;
|
|
3552
|
+
hasDefault: false;
|
|
3553
|
+
isPrimaryKey: false;
|
|
3554
|
+
isAutoincrement: false;
|
|
3555
|
+
hasRuntimeDefault: false;
|
|
3556
|
+
enumValues: undefined;
|
|
3557
|
+
baseColumn: never;
|
|
3558
|
+
identity: undefined;
|
|
3559
|
+
generated: undefined;
|
|
3560
|
+
}, {}, {}>;
|
|
3561
|
+
displayName: drizzle_orm_pg_core.PgColumn<{
|
|
3562
|
+
name: "display_name";
|
|
3563
|
+
tableName: "items";
|
|
3564
|
+
dataType: "string";
|
|
3565
|
+
columnType: "PgText";
|
|
3566
|
+
data: string;
|
|
3567
|
+
driverParam: string;
|
|
3568
|
+
notNull: true;
|
|
3569
|
+
hasDefault: false;
|
|
3570
|
+
isPrimaryKey: false;
|
|
3571
|
+
isAutoincrement: false;
|
|
3572
|
+
hasRuntimeDefault: false;
|
|
3573
|
+
enumValues: [string, ...string[]];
|
|
3574
|
+
baseColumn: never;
|
|
3575
|
+
identity: undefined;
|
|
3576
|
+
generated: undefined;
|
|
3577
|
+
}, {}, {}>;
|
|
3578
|
+
description: drizzle_orm_pg_core.PgColumn<{
|
|
3579
|
+
name: "description";
|
|
3580
|
+
tableName: "items";
|
|
3581
|
+
dataType: "string";
|
|
3582
|
+
columnType: "PgText";
|
|
3583
|
+
data: string;
|
|
3584
|
+
driverParam: string;
|
|
3585
|
+
notNull: false;
|
|
3586
|
+
hasDefault: false;
|
|
3587
|
+
isPrimaryKey: false;
|
|
3588
|
+
isAutoincrement: false;
|
|
3589
|
+
hasRuntimeDefault: false;
|
|
3590
|
+
enumValues: [string, ...string[]];
|
|
3591
|
+
baseColumn: never;
|
|
3592
|
+
identity: undefined;
|
|
3593
|
+
generated: undefined;
|
|
3594
|
+
}, {}, {}>;
|
|
3595
|
+
type: drizzle_orm_pg_core.PgColumn<{
|
|
3596
|
+
name: "type";
|
|
3597
|
+
tableName: "items";
|
|
3598
|
+
dataType: "string";
|
|
3599
|
+
columnType: "PgEnumColumn";
|
|
3600
|
+
data: "accessory" | "badge" | "collectible" | "consumable" | "currency" | "other" | "trophy" | "unlock" | "upgrade";
|
|
3601
|
+
driverParam: string;
|
|
3602
|
+
notNull: true;
|
|
3603
|
+
hasDefault: true;
|
|
3604
|
+
isPrimaryKey: false;
|
|
3605
|
+
isAutoincrement: false;
|
|
3606
|
+
hasRuntimeDefault: false;
|
|
3607
|
+
enumValues: ["currency", "badge", "trophy", "collectible", "consumable", "unlock", "upgrade", "accessory", "other"];
|
|
3608
|
+
baseColumn: never;
|
|
3609
|
+
identity: undefined;
|
|
3610
|
+
generated: undefined;
|
|
3611
|
+
}, {}, {}>;
|
|
3612
|
+
isPlaceable: drizzle_orm_pg_core.PgColumn<{
|
|
3613
|
+
name: "is_placeable";
|
|
3614
|
+
tableName: "items";
|
|
3615
|
+
dataType: "boolean";
|
|
3616
|
+
columnType: "PgBoolean";
|
|
3617
|
+
data: boolean;
|
|
3618
|
+
driverParam: boolean;
|
|
3619
|
+
notNull: true;
|
|
3620
|
+
hasDefault: true;
|
|
3621
|
+
isPrimaryKey: false;
|
|
3622
|
+
isAutoincrement: false;
|
|
3623
|
+
hasRuntimeDefault: false;
|
|
3624
|
+
enumValues: undefined;
|
|
3625
|
+
baseColumn: never;
|
|
3626
|
+
identity: undefined;
|
|
3627
|
+
generated: undefined;
|
|
3628
|
+
}, {}, {}>;
|
|
3629
|
+
imageUrl: drizzle_orm_pg_core.PgColumn<{
|
|
3630
|
+
name: "image_url";
|
|
3631
|
+
tableName: "items";
|
|
3632
|
+
dataType: "string";
|
|
3633
|
+
columnType: "PgText";
|
|
3634
|
+
data: string;
|
|
3635
|
+
driverParam: string;
|
|
3636
|
+
notNull: false;
|
|
3637
|
+
hasDefault: false;
|
|
3638
|
+
isPrimaryKey: false;
|
|
3639
|
+
isAutoincrement: false;
|
|
3640
|
+
hasRuntimeDefault: false;
|
|
3641
|
+
enumValues: [string, ...string[]];
|
|
3642
|
+
baseColumn: never;
|
|
3643
|
+
identity: undefined;
|
|
3644
|
+
generated: undefined;
|
|
3645
|
+
}, {}, {}>;
|
|
3646
|
+
metadata: drizzle_orm_pg_core.PgColumn<{
|
|
3647
|
+
name: "metadata";
|
|
3648
|
+
tableName: "items";
|
|
3649
|
+
dataType: "json";
|
|
3650
|
+
columnType: "PgJsonb";
|
|
3651
|
+
data: unknown;
|
|
3652
|
+
driverParam: unknown;
|
|
3653
|
+
notNull: false;
|
|
3654
|
+
hasDefault: true;
|
|
3655
|
+
isPrimaryKey: false;
|
|
3656
|
+
isAutoincrement: false;
|
|
3657
|
+
hasRuntimeDefault: false;
|
|
3658
|
+
enumValues: undefined;
|
|
3659
|
+
baseColumn: never;
|
|
3660
|
+
identity: undefined;
|
|
3661
|
+
generated: undefined;
|
|
3662
|
+
}, {}, {}>;
|
|
3663
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
3664
|
+
name: "created_at";
|
|
3665
|
+
tableName: "items";
|
|
3666
|
+
dataType: "date";
|
|
3667
|
+
columnType: "PgTimestamp";
|
|
3668
|
+
data: Date;
|
|
3669
|
+
driverParam: string;
|
|
3670
|
+
notNull: true;
|
|
3671
|
+
hasDefault: true;
|
|
3672
|
+
isPrimaryKey: false;
|
|
3673
|
+
isAutoincrement: false;
|
|
3674
|
+
hasRuntimeDefault: false;
|
|
3675
|
+
enumValues: undefined;
|
|
3676
|
+
baseColumn: never;
|
|
3677
|
+
identity: undefined;
|
|
3678
|
+
generated: undefined;
|
|
3679
|
+
}, {}, {}>;
|
|
3680
|
+
}, {
|
|
3681
|
+
imageUrl: z.ZodNullable<z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>>;
|
|
3682
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3683
|
+
}>;
|
|
3684
|
+
declare const UpdateItemSchema: z.ZodObject<Omit<{
|
|
3685
|
+
id: z.ZodOptional<z.ZodString>;
|
|
3686
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
3687
|
+
gameId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3688
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
3689
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3690
|
+
type: z.ZodOptional<z.ZodEnum<["currency", "badge", "trophy", "collectible", "consumable", "unlock", "upgrade", "accessory", "other"]>>;
|
|
3691
|
+
isPlaceable: z.ZodOptional<z.ZodBoolean>;
|
|
3692
|
+
imageUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3693
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3694
|
+
createdAt: z.ZodOptional<z.ZodDate>;
|
|
3695
|
+
}, "createdAt" | "id">, "strip", z.ZodTypeAny, {
|
|
3696
|
+
slug?: string | undefined;
|
|
3697
|
+
gameId?: string | null | undefined;
|
|
3698
|
+
displayName?: string | undefined;
|
|
3699
|
+
description?: string | null | undefined;
|
|
3700
|
+
type?: "accessory" | "badge" | "collectible" | "consumable" | "currency" | "other" | "trophy" | "unlock" | "upgrade" | undefined;
|
|
3701
|
+
isPlaceable?: boolean | undefined;
|
|
3702
|
+
imageUrl?: string | null | undefined;
|
|
3703
|
+
metadata?: Record<string, unknown> | undefined;
|
|
3704
|
+
}, {
|
|
3705
|
+
slug?: string | undefined;
|
|
3706
|
+
gameId?: string | null | undefined;
|
|
3707
|
+
displayName?: string | undefined;
|
|
3708
|
+
description?: string | null | undefined;
|
|
3709
|
+
type?: "accessory" | "badge" | "collectible" | "consumable" | "currency" | "other" | "trophy" | "unlock" | "upgrade" | undefined;
|
|
3710
|
+
isPlaceable?: boolean | undefined;
|
|
3711
|
+
imageUrl?: string | null | undefined;
|
|
3712
|
+
metadata?: Record<string, unknown> | undefined;
|
|
3713
|
+
}>;
|
|
3714
|
+
declare const InsertCurrencySchema: drizzle_zod.BuildSchema<"insert", {
|
|
3715
|
+
id: drizzle_orm_pg_core.PgColumn<{
|
|
3716
|
+
name: "id";
|
|
3717
|
+
tableName: "currencies";
|
|
3718
|
+
dataType: "string";
|
|
3719
|
+
columnType: "PgUUID";
|
|
3720
|
+
data: string;
|
|
3721
|
+
driverParam: string;
|
|
3722
|
+
notNull: true;
|
|
3723
|
+
hasDefault: true;
|
|
3724
|
+
isPrimaryKey: true;
|
|
3725
|
+
isAutoincrement: false;
|
|
3726
|
+
hasRuntimeDefault: false;
|
|
3727
|
+
enumValues: undefined;
|
|
3728
|
+
baseColumn: never;
|
|
3729
|
+
identity: undefined;
|
|
3730
|
+
generated: undefined;
|
|
3731
|
+
}, {}, {}>;
|
|
3732
|
+
itemId: drizzle_orm_pg_core.PgColumn<{
|
|
3733
|
+
name: "item_id";
|
|
3734
|
+
tableName: "currencies";
|
|
3735
|
+
dataType: "string";
|
|
3736
|
+
columnType: "PgUUID";
|
|
3737
|
+
data: string;
|
|
3738
|
+
driverParam: string;
|
|
3739
|
+
notNull: true;
|
|
3740
|
+
hasDefault: false;
|
|
3741
|
+
isPrimaryKey: false;
|
|
3742
|
+
isAutoincrement: false;
|
|
3743
|
+
hasRuntimeDefault: false;
|
|
3744
|
+
enumValues: undefined;
|
|
3745
|
+
baseColumn: never;
|
|
3746
|
+
identity: undefined;
|
|
3747
|
+
generated: undefined;
|
|
3748
|
+
}, {}, {}>;
|
|
3749
|
+
symbol: drizzle_orm_pg_core.PgColumn<{
|
|
3750
|
+
name: "symbol";
|
|
3751
|
+
tableName: "currencies";
|
|
3752
|
+
dataType: "string";
|
|
3753
|
+
columnType: "PgText";
|
|
3754
|
+
data: string;
|
|
3755
|
+
driverParam: string;
|
|
3756
|
+
notNull: false;
|
|
3757
|
+
hasDefault: false;
|
|
3758
|
+
isPrimaryKey: false;
|
|
3759
|
+
isAutoincrement: false;
|
|
3760
|
+
hasRuntimeDefault: false;
|
|
3761
|
+
enumValues: [string, ...string[]];
|
|
3762
|
+
baseColumn: never;
|
|
3763
|
+
identity: undefined;
|
|
3764
|
+
generated: undefined;
|
|
3765
|
+
}, {}, {}>;
|
|
3766
|
+
isPrimary: drizzle_orm_pg_core.PgColumn<{
|
|
3767
|
+
name: "is_primary";
|
|
3768
|
+
tableName: "currencies";
|
|
3769
|
+
dataType: "boolean";
|
|
3770
|
+
columnType: "PgBoolean";
|
|
3771
|
+
data: boolean;
|
|
3772
|
+
driverParam: boolean;
|
|
3773
|
+
notNull: true;
|
|
3774
|
+
hasDefault: true;
|
|
3775
|
+
isPrimaryKey: false;
|
|
3776
|
+
isAutoincrement: false;
|
|
3777
|
+
hasRuntimeDefault: false;
|
|
3778
|
+
enumValues: undefined;
|
|
3779
|
+
baseColumn: never;
|
|
3780
|
+
identity: undefined;
|
|
3781
|
+
generated: undefined;
|
|
3782
|
+
}, {}, {}>;
|
|
3783
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
3784
|
+
name: "created_at";
|
|
3785
|
+
tableName: "currencies";
|
|
3786
|
+
dataType: "date";
|
|
3787
|
+
columnType: "PgTimestamp";
|
|
3788
|
+
data: Date;
|
|
3789
|
+
driverParam: string;
|
|
3790
|
+
notNull: true;
|
|
3791
|
+
hasDefault: true;
|
|
3792
|
+
isPrimaryKey: false;
|
|
3793
|
+
isAutoincrement: false;
|
|
3794
|
+
hasRuntimeDefault: false;
|
|
3795
|
+
enumValues: undefined;
|
|
3796
|
+
baseColumn: never;
|
|
3797
|
+
identity: undefined;
|
|
3798
|
+
generated: undefined;
|
|
3799
|
+
}, {}, {}>;
|
|
3800
|
+
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
3801
|
+
name: "updated_at";
|
|
3802
|
+
tableName: "currencies";
|
|
3803
|
+
dataType: "date";
|
|
3804
|
+
columnType: "PgTimestamp";
|
|
3805
|
+
data: Date;
|
|
3806
|
+
driverParam: string;
|
|
3807
|
+
notNull: false;
|
|
3808
|
+
hasDefault: true;
|
|
3809
|
+
isPrimaryKey: false;
|
|
3810
|
+
isAutoincrement: false;
|
|
3811
|
+
hasRuntimeDefault: false;
|
|
3812
|
+
enumValues: undefined;
|
|
3813
|
+
baseColumn: never;
|
|
3814
|
+
identity: undefined;
|
|
3815
|
+
generated: undefined;
|
|
3816
|
+
}, {}, {}>;
|
|
3817
|
+
}, {
|
|
3818
|
+
itemId: z.ZodString;
|
|
3819
|
+
isPrimary: z.ZodDefault<z.ZodBoolean>;
|
|
3820
|
+
}>;
|
|
3821
|
+
declare const UpdateCurrencySchema: z.ZodObject<{
|
|
3822
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
3823
|
+
symbol: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
3824
|
+
isPrimary: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
2368
3825
|
}, "strip", z.ZodTypeAny, {
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
3826
|
+
itemId?: string | undefined;
|
|
3827
|
+
symbol?: string | null | undefined;
|
|
3828
|
+
isPrimary?: boolean | undefined;
|
|
2372
3829
|
}, {
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
3830
|
+
itemId?: string | undefined;
|
|
3831
|
+
symbol?: string | null | undefined;
|
|
3832
|
+
isPrimary?: boolean | undefined;
|
|
3833
|
+
}>;
|
|
3834
|
+
declare const InsertShopListingSchema: drizzle_zod.BuildSchema<"insert", {
|
|
3835
|
+
id: drizzle_orm_pg_core.PgColumn<{
|
|
3836
|
+
name: "id";
|
|
3837
|
+
tableName: "shop_listings";
|
|
3838
|
+
dataType: "string";
|
|
3839
|
+
columnType: "PgUUID";
|
|
3840
|
+
data: string;
|
|
3841
|
+
driverParam: string;
|
|
3842
|
+
notNull: true;
|
|
3843
|
+
hasDefault: true;
|
|
3844
|
+
isPrimaryKey: true;
|
|
3845
|
+
isAutoincrement: false;
|
|
3846
|
+
hasRuntimeDefault: false;
|
|
3847
|
+
enumValues: undefined;
|
|
3848
|
+
baseColumn: never;
|
|
3849
|
+
identity: undefined;
|
|
3850
|
+
generated: undefined;
|
|
3851
|
+
}, {}, {}>;
|
|
3852
|
+
itemId: drizzle_orm_pg_core.PgColumn<{
|
|
3853
|
+
name: "item_id";
|
|
3854
|
+
tableName: "shop_listings";
|
|
3855
|
+
dataType: "string";
|
|
3856
|
+
columnType: "PgUUID";
|
|
3857
|
+
data: string;
|
|
3858
|
+
driverParam: string;
|
|
3859
|
+
notNull: true;
|
|
3860
|
+
hasDefault: false;
|
|
3861
|
+
isPrimaryKey: false;
|
|
3862
|
+
isAutoincrement: false;
|
|
3863
|
+
hasRuntimeDefault: false;
|
|
3864
|
+
enumValues: undefined;
|
|
3865
|
+
baseColumn: never;
|
|
3866
|
+
identity: undefined;
|
|
3867
|
+
generated: undefined;
|
|
3868
|
+
}, {}, {}>;
|
|
3869
|
+
currencyId: drizzle_orm_pg_core.PgColumn<{
|
|
3870
|
+
name: "currency_id";
|
|
3871
|
+
tableName: "shop_listings";
|
|
3872
|
+
dataType: "string";
|
|
3873
|
+
columnType: "PgUUID";
|
|
3874
|
+
data: string;
|
|
3875
|
+
driverParam: string;
|
|
3876
|
+
notNull: true;
|
|
3877
|
+
hasDefault: false;
|
|
3878
|
+
isPrimaryKey: false;
|
|
3879
|
+
isAutoincrement: false;
|
|
3880
|
+
hasRuntimeDefault: false;
|
|
3881
|
+
enumValues: undefined;
|
|
3882
|
+
baseColumn: never;
|
|
3883
|
+
identity: undefined;
|
|
3884
|
+
generated: undefined;
|
|
3885
|
+
}, {}, {}>;
|
|
3886
|
+
price: drizzle_orm_pg_core.PgColumn<{
|
|
3887
|
+
name: "price";
|
|
3888
|
+
tableName: "shop_listings";
|
|
3889
|
+
dataType: "number";
|
|
3890
|
+
columnType: "PgInteger";
|
|
3891
|
+
data: number;
|
|
3892
|
+
driverParam: string | number;
|
|
3893
|
+
notNull: true;
|
|
3894
|
+
hasDefault: false;
|
|
3895
|
+
isPrimaryKey: false;
|
|
3896
|
+
isAutoincrement: false;
|
|
3897
|
+
hasRuntimeDefault: false;
|
|
3898
|
+
enumValues: undefined;
|
|
3899
|
+
baseColumn: never;
|
|
3900
|
+
identity: undefined;
|
|
3901
|
+
generated: undefined;
|
|
3902
|
+
}, {}, {}>;
|
|
3903
|
+
sellBackPercentage: drizzle_orm_pg_core.PgColumn<{
|
|
3904
|
+
name: "sell_back_percentage";
|
|
3905
|
+
tableName: "shop_listings";
|
|
3906
|
+
dataType: "number";
|
|
3907
|
+
columnType: "PgInteger";
|
|
3908
|
+
data: number;
|
|
3909
|
+
driverParam: string | number;
|
|
3910
|
+
notNull: false;
|
|
3911
|
+
hasDefault: false;
|
|
3912
|
+
isPrimaryKey: false;
|
|
3913
|
+
isAutoincrement: false;
|
|
3914
|
+
hasRuntimeDefault: false;
|
|
3915
|
+
enumValues: undefined;
|
|
3916
|
+
baseColumn: never;
|
|
3917
|
+
identity: undefined;
|
|
3918
|
+
generated: undefined;
|
|
3919
|
+
}, {}, {}>;
|
|
3920
|
+
stock: drizzle_orm_pg_core.PgColumn<{
|
|
3921
|
+
name: "stock";
|
|
3922
|
+
tableName: "shop_listings";
|
|
3923
|
+
dataType: "number";
|
|
3924
|
+
columnType: "PgInteger";
|
|
3925
|
+
data: number;
|
|
3926
|
+
driverParam: string | number;
|
|
3927
|
+
notNull: false;
|
|
3928
|
+
hasDefault: false;
|
|
3929
|
+
isPrimaryKey: false;
|
|
3930
|
+
isAutoincrement: false;
|
|
3931
|
+
hasRuntimeDefault: false;
|
|
3932
|
+
enumValues: undefined;
|
|
3933
|
+
baseColumn: never;
|
|
3934
|
+
identity: undefined;
|
|
3935
|
+
generated: undefined;
|
|
3936
|
+
}, {}, {}>;
|
|
3937
|
+
isActive: drizzle_orm_pg_core.PgColumn<{
|
|
3938
|
+
name: "is_active";
|
|
3939
|
+
tableName: "shop_listings";
|
|
3940
|
+
dataType: "boolean";
|
|
3941
|
+
columnType: "PgBoolean";
|
|
3942
|
+
data: boolean;
|
|
3943
|
+
driverParam: boolean;
|
|
3944
|
+
notNull: true;
|
|
3945
|
+
hasDefault: true;
|
|
3946
|
+
isPrimaryKey: false;
|
|
3947
|
+
isAutoincrement: false;
|
|
3948
|
+
hasRuntimeDefault: false;
|
|
3949
|
+
enumValues: undefined;
|
|
3950
|
+
baseColumn: never;
|
|
3951
|
+
identity: undefined;
|
|
3952
|
+
generated: undefined;
|
|
3953
|
+
}, {}, {}>;
|
|
3954
|
+
availableFrom: drizzle_orm_pg_core.PgColumn<{
|
|
3955
|
+
name: "available_from";
|
|
3956
|
+
tableName: "shop_listings";
|
|
3957
|
+
dataType: "date";
|
|
3958
|
+
columnType: "PgTimestamp";
|
|
3959
|
+
data: Date;
|
|
3960
|
+
driverParam: string;
|
|
3961
|
+
notNull: false;
|
|
3962
|
+
hasDefault: false;
|
|
3963
|
+
isPrimaryKey: false;
|
|
3964
|
+
isAutoincrement: false;
|
|
3965
|
+
hasRuntimeDefault: false;
|
|
3966
|
+
enumValues: undefined;
|
|
3967
|
+
baseColumn: never;
|
|
3968
|
+
identity: undefined;
|
|
3969
|
+
generated: undefined;
|
|
3970
|
+
}, {}, {}>;
|
|
3971
|
+
availableUntil: drizzle_orm_pg_core.PgColumn<{
|
|
3972
|
+
name: "available_until";
|
|
3973
|
+
tableName: "shop_listings";
|
|
3974
|
+
dataType: "date";
|
|
3975
|
+
columnType: "PgTimestamp";
|
|
3976
|
+
data: Date;
|
|
3977
|
+
driverParam: string;
|
|
3978
|
+
notNull: false;
|
|
3979
|
+
hasDefault: false;
|
|
3980
|
+
isPrimaryKey: false;
|
|
3981
|
+
isAutoincrement: false;
|
|
3982
|
+
hasRuntimeDefault: false;
|
|
3983
|
+
enumValues: undefined;
|
|
3984
|
+
baseColumn: never;
|
|
3985
|
+
identity: undefined;
|
|
3986
|
+
generated: undefined;
|
|
3987
|
+
}, {}, {}>;
|
|
3988
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
3989
|
+
name: "created_at";
|
|
3990
|
+
tableName: "shop_listings";
|
|
3991
|
+
dataType: "date";
|
|
3992
|
+
columnType: "PgTimestamp";
|
|
3993
|
+
data: Date;
|
|
3994
|
+
driverParam: string;
|
|
3995
|
+
notNull: true;
|
|
3996
|
+
hasDefault: true;
|
|
3997
|
+
isPrimaryKey: false;
|
|
3998
|
+
isAutoincrement: false;
|
|
3999
|
+
hasRuntimeDefault: false;
|
|
4000
|
+
enumValues: undefined;
|
|
4001
|
+
baseColumn: never;
|
|
4002
|
+
identity: undefined;
|
|
4003
|
+
generated: undefined;
|
|
4004
|
+
}, {}, {}>;
|
|
4005
|
+
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
4006
|
+
name: "updated_at";
|
|
4007
|
+
tableName: "shop_listings";
|
|
4008
|
+
dataType: "date";
|
|
4009
|
+
columnType: "PgTimestamp";
|
|
4010
|
+
data: Date;
|
|
4011
|
+
driverParam: string;
|
|
4012
|
+
notNull: false;
|
|
4013
|
+
hasDefault: true;
|
|
4014
|
+
isPrimaryKey: false;
|
|
4015
|
+
isAutoincrement: false;
|
|
4016
|
+
hasRuntimeDefault: false;
|
|
4017
|
+
enumValues: undefined;
|
|
4018
|
+
baseColumn: never;
|
|
4019
|
+
identity: undefined;
|
|
4020
|
+
generated: undefined;
|
|
4021
|
+
}, {}, {}>;
|
|
4022
|
+
}, {
|
|
4023
|
+
price: z.ZodNumber;
|
|
4024
|
+
sellBackPercentage: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
4025
|
+
stock: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
4026
|
+
isActive: z.ZodDefault<z.ZodBoolean>;
|
|
4027
|
+
}>;
|
|
4028
|
+
declare const UpdateShopListingSchema: z.ZodObject<{
|
|
4029
|
+
id: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
4030
|
+
itemId: z.ZodOptional<z.ZodString>;
|
|
4031
|
+
currencyId: z.ZodOptional<z.ZodString>;
|
|
4032
|
+
price: z.ZodOptional<z.ZodNumber>;
|
|
4033
|
+
sellBackPercentage: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNumber>>>;
|
|
4034
|
+
stock: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNumber>>>;
|
|
4035
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
4036
|
+
availableFrom: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodDate>>>;
|
|
4037
|
+
availableUntil: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodDate>>>;
|
|
4038
|
+
createdAt: z.ZodOptional<z.ZodOptional<z.ZodDate>>;
|
|
4039
|
+
updatedAt: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodDate>>>;
|
|
4040
|
+
}, "strip", z.ZodTypeAny, {
|
|
4041
|
+
id?: string | undefined;
|
|
4042
|
+
itemId?: string | undefined;
|
|
4043
|
+
currencyId?: string | undefined;
|
|
4044
|
+
price?: number | undefined;
|
|
4045
|
+
sellBackPercentage?: number | null | undefined;
|
|
4046
|
+
stock?: number | null | undefined;
|
|
4047
|
+
isActive?: boolean | undefined;
|
|
4048
|
+
availableFrom?: Date | null | undefined;
|
|
4049
|
+
availableUntil?: Date | null | undefined;
|
|
4050
|
+
createdAt?: Date | undefined;
|
|
4051
|
+
updatedAt?: Date | null | undefined;
|
|
4052
|
+
}, {
|
|
4053
|
+
id?: string | undefined;
|
|
4054
|
+
itemId?: string | undefined;
|
|
4055
|
+
currencyId?: string | undefined;
|
|
4056
|
+
price?: number | undefined;
|
|
4057
|
+
sellBackPercentage?: number | null | undefined;
|
|
4058
|
+
stock?: number | null | undefined;
|
|
4059
|
+
isActive?: boolean | undefined;
|
|
4060
|
+
availableFrom?: Date | null | undefined;
|
|
4061
|
+
availableUntil?: Date | null | undefined;
|
|
4062
|
+
createdAt?: Date | undefined;
|
|
4063
|
+
updatedAt?: Date | null | undefined;
|
|
2376
4064
|
}>;
|
|
2377
4065
|
|
|
2378
|
-
declare enum AchievementCompletionType {
|
|
2379
|
-
TIME_PLAYED_SESSION = "time_played_session",
|
|
2380
|
-
INTERACTION = "interaction",
|
|
2381
|
-
LEADERBOARD_RANK = "leaderboard_rank",
|
|
2382
|
-
FIRST_SCORE = "first_score",
|
|
2383
|
-
PERSONAL_BEST = "personal_best"
|
|
2384
|
-
}
|
|
2385
|
-
type AchievementScopeType = (typeof achievementScopeEnum.enumValues)[number];
|
|
2386
|
-
type Achievement = typeof achievements.$inferSelect;
|
|
2387
|
-
/**
|
|
2388
|
-
* Current-scope achievement with computed status and window metadata
|
|
2389
|
-
*/
|
|
2390
|
-
interface AchievementCurrent {
|
|
2391
|
-
id: string;
|
|
2392
|
-
title: string;
|
|
2393
|
-
description?: string | null;
|
|
2394
|
-
scope: AchievementScopeType;
|
|
2395
|
-
rewardCredits: number;
|
|
2396
|
-
limit: number;
|
|
2397
|
-
completionType: AchievementCompletionType;
|
|
2398
|
-
completionConfig: Record<string, unknown>;
|
|
2399
|
-
target: Record<string, unknown>;
|
|
2400
|
-
active: boolean;
|
|
2401
|
-
createdAt?: Date;
|
|
2402
|
-
updatedAt?: Date;
|
|
2403
|
-
status: 'available' | 'completed';
|
|
2404
|
-
scopeKey: string;
|
|
2405
|
-
windowStart: string;
|
|
2406
|
-
windowEnd: string;
|
|
2407
|
-
}
|
|
2408
|
-
/**
|
|
2409
|
-
* Achievement progress submission response
|
|
2410
|
-
* Used in POST /api/achievements/progress
|
|
2411
|
-
*/
|
|
2412
|
-
interface AchievementProgressResponse {
|
|
2413
|
-
achievementId: string;
|
|
2414
|
-
status: 'completed' | 'already_completed';
|
|
2415
|
-
rewardCredits: number;
|
|
2416
|
-
scopeKey: string;
|
|
2417
|
-
createdAt: string;
|
|
2418
|
-
}
|
|
2419
|
-
|
|
2420
|
-
type CharacterComponent = typeof characterComponents.$inferSelect;
|
|
2421
|
-
type PlayerCharacter = typeof playerCharacters.$inferSelect & {
|
|
2422
|
-
accessories?: PlayerCharacterAccessory[];
|
|
2423
|
-
};
|
|
2424
|
-
type PlayerCharacterAccessory = typeof playerCharacterAccessories.$inferSelect;
|
|
2425
4066
|
type GameRow = typeof games.$inferSelect;
|
|
2426
4067
|
type BaseGame = Omit<GameRow, 'gameType' | 'deploymentUrl' | 'externalUrl'>;
|
|
2427
4068
|
type HostedGame = BaseGame & {
|
|
@@ -2435,68 +4076,43 @@ type ExternalGame = BaseGame & {
|
|
|
2435
4076
|
externalUrl: string;
|
|
2436
4077
|
};
|
|
2437
4078
|
type Game = HostedGame | ExternalGame;
|
|
2438
|
-
type
|
|
2439
|
-
type
|
|
2440
|
-
type Item = typeof items.$inferSelect;
|
|
2441
|
-
type InventoryItem = typeof inventoryItems.$inferSelect;
|
|
2442
|
-
type Currency = typeof currencies.$inferSelect;
|
|
2443
|
-
interface PlaceableItemMetadata {
|
|
2444
|
-
tilesWide?: number;
|
|
2445
|
-
tilesHigh?: number;
|
|
2446
|
-
flippable?: boolean;
|
|
2447
|
-
[key: string]: unknown;
|
|
2448
|
-
}
|
|
2449
|
-
type Map = typeof maps.$inferSelect;
|
|
2450
|
-
type MapElement = typeof mapElements.$inferSelect;
|
|
2451
|
-
type MapObject = typeof mapObjects.$inferSelect;
|
|
4079
|
+
type GameSessionRow = typeof gameSessions.$inferSelect;
|
|
4080
|
+
type GameCustomHostnameRow = typeof gameCustomHostnames.$inferSelect;
|
|
2452
4081
|
|
|
2453
|
-
type
|
|
2454
|
-
|
|
2455
|
-
type
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
type
|
|
2461
|
-
|
|
2462
|
-
hasTimebackAccount: boolean;
|
|
4082
|
+
type UpsertGameMetadataInput = z.infer<typeof UpsertGameMetadataSchema>;
|
|
4083
|
+
|
|
4084
|
+
type MapRow = typeof maps.$inferSelect;
|
|
4085
|
+
type MapElementRow = typeof mapElements.$inferSelect;
|
|
4086
|
+
type MapObjectRow = typeof mapObjects.$inferSelect;
|
|
4087
|
+
|
|
4088
|
+
type CharacterComponentRow = typeof characterComponents.$inferSelect;
|
|
4089
|
+
type PlayerCharacterRow = typeof playerCharacters.$inferSelect & {
|
|
4090
|
+
accessories?: PlayerCharacterAccessoryRow[];
|
|
2463
4091
|
};
|
|
4092
|
+
type PlayerCharacterAccessoryRow = typeof playerCharacterAccessories.$inferSelect;
|
|
4093
|
+
|
|
4094
|
+
type ItemRow = typeof items.$inferSelect;
|
|
4095
|
+
type InventoryItemRow = typeof inventoryItems.$inferSelect;
|
|
4096
|
+
type CurrencyRow = typeof currencies.$inferSelect;
|
|
4097
|
+
type ShopListingRow = typeof shopListings.$inferSelect;
|
|
4098
|
+
type InsertItemInput = z.infer<typeof InsertItemSchema>;
|
|
4099
|
+
type UpdateItemInput = z.infer<typeof UpdateItemSchema>;
|
|
4100
|
+
type InsertCurrencyInput = z.infer<typeof InsertCurrencySchema>;
|
|
4101
|
+
type UpdateCurrencyInput = z.infer<typeof UpdateCurrencySchema>;
|
|
4102
|
+
type InsertShopListingInput = z.infer<typeof InsertShopListingSchema>;
|
|
4103
|
+
type UpdateShopListingInput = z.infer<typeof UpdateShopListingSchema>;
|
|
4104
|
+
|
|
4105
|
+
type UserRow = typeof users.$inferSelect;
|
|
2464
4106
|
|
|
2465
4107
|
/**
|
|
2466
4108
|
* Cross-Domain Composite Types
|
|
2467
4109
|
* Types that combine data from multiple domains
|
|
2468
4110
|
*/
|
|
2469
|
-
type
|
|
2470
|
-
/**
|
|
2471
|
-
* Basic user information in the shape of the claims from identity providers
|
|
2472
|
-
*/
|
|
2473
|
-
interface UserInfo {
|
|
2474
|
-
/** Unique user identifier (sub claim from JWT) */
|
|
2475
|
-
sub: string;
|
|
2476
|
-
/** User's email address */
|
|
2477
|
-
email: string;
|
|
2478
|
-
/** User's display name */
|
|
2479
|
-
name: string;
|
|
2480
|
-
/** Whether the email has been verified */
|
|
2481
|
-
email_verified: boolean;
|
|
2482
|
-
/** Optional given name (first name) */
|
|
2483
|
-
given_name?: string;
|
|
2484
|
-
/** Optional family name (last name) */
|
|
2485
|
-
family_name?: string;
|
|
2486
|
-
/** TimeBack student ID (if user has TimeBack integration) */
|
|
2487
|
-
timeback_id?: string;
|
|
2488
|
-
/** Additional user attributes from the identity provider */
|
|
2489
|
-
[key: string]: unknown;
|
|
2490
|
-
}
|
|
2491
|
-
/**
|
|
2492
|
-
* Character-related Composite Types
|
|
2493
|
-
* Types that combine character component data with sprite sheet information
|
|
2494
|
-
*/
|
|
2495
|
-
type CharacterComponentWithSpriteUrl = CharacterComponent & {
|
|
4111
|
+
type CharacterComponentWithSpriteUrl = CharacterComponentRow & {
|
|
2496
4112
|
spriteSheetUrl: string;
|
|
2497
4113
|
};
|
|
2498
|
-
type InventoryItemWithItem =
|
|
2499
|
-
item:
|
|
4114
|
+
type InventoryItemWithItem = InventoryItemRow & {
|
|
4115
|
+
item: ItemRow;
|
|
2500
4116
|
};
|
|
2501
4117
|
/**
|
|
2502
4118
|
* Game with optional manifest metadata from build tools
|
|
@@ -2505,22 +4121,159 @@ type FetchedGame = (HostedGame | ExternalGame | GameRow) & {
|
|
|
2505
4121
|
manifest?: ManifestV1;
|
|
2506
4122
|
};
|
|
2507
4123
|
/**
|
|
2508
|
-
*
|
|
2509
|
-
*
|
|
4124
|
+
* Session Bootstrap Payload Types
|
|
4125
|
+
* Complex types that combine user, inventory, game, and map data for client initialization
|
|
2510
4126
|
*/
|
|
2511
|
-
interface
|
|
2512
|
-
|
|
4127
|
+
interface PlayerProfile {
|
|
4128
|
+
userId: UserRow['id'];
|
|
4129
|
+
username: UserRow['username'];
|
|
4130
|
+
name: UserRow['name'];
|
|
4131
|
+
image?: UserRow['image'];
|
|
4132
|
+
role?: UserRow['role'];
|
|
4133
|
+
level?: number;
|
|
4134
|
+
experience?: number;
|
|
4135
|
+
experienceToNextLevel?: number;
|
|
4136
|
+
characterCreated?: UserRow['characterCreated'];
|
|
4137
|
+
hasTimebackAccount?: boolean;
|
|
4138
|
+
}
|
|
4139
|
+
interface PlayerCurrency {
|
|
4140
|
+
currencySystemId: CurrencyRow['id'];
|
|
4141
|
+
itemId: ItemRow['id'];
|
|
4142
|
+
name: ItemRow['displayName'];
|
|
4143
|
+
symbol?: CurrencyRow['symbol'];
|
|
4144
|
+
imageUrl?: ItemRow['imageUrl'];
|
|
4145
|
+
isPrimary: CurrencyRow['isPrimary'];
|
|
4146
|
+
balance: number;
|
|
4147
|
+
}
|
|
4148
|
+
interface PlayerInventoryItem {
|
|
4149
|
+
inventoryItemEntryId: InventoryItemRow['id'];
|
|
4150
|
+
item: ItemRow;
|
|
4151
|
+
quantity: InventoryItemRow['quantity'];
|
|
4152
|
+
updatedAt: InventoryItemRow['updatedAt'];
|
|
4153
|
+
}
|
|
4154
|
+
interface PlayerLocation {
|
|
4155
|
+
mapIdentifier: MapRow['identifier'];
|
|
4156
|
+
mapDisplayName: MapRow['displayName'];
|
|
4157
|
+
tileX?: number;
|
|
4158
|
+
tileY?: number;
|
|
4159
|
+
worldX?: number;
|
|
4160
|
+
worldY?: number;
|
|
4161
|
+
direction?: 'up' | 'down' | 'left' | 'right';
|
|
4162
|
+
}
|
|
4163
|
+
interface PlayerSessionPayload {
|
|
4164
|
+
profile: PlayerProfile;
|
|
4165
|
+
currencies: PlayerCurrency[];
|
|
4166
|
+
inventory: PlayerInventoryItem[];
|
|
4167
|
+
ownedGameIds: Game['id'][];
|
|
4168
|
+
currentLocation?: PlayerLocation;
|
|
4169
|
+
characterCreated?: UserRow['characterCreated'];
|
|
4170
|
+
playerCharacter?: PlayerCharacterRow | null;
|
|
2513
4171
|
}
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
4172
|
+
/**
|
|
4173
|
+
* Map-related Composite Types
|
|
4174
|
+
* DB row + joined game/item data
|
|
4175
|
+
*/
|
|
4176
|
+
type MapElementWithGame = MapElementRow & {
|
|
4177
|
+
game: {
|
|
4178
|
+
id: string;
|
|
4179
|
+
displayName: string;
|
|
4180
|
+
} | null;
|
|
4181
|
+
};
|
|
4182
|
+
type MapObjectWithItem = MapObjectRow & {
|
|
4183
|
+
item: {
|
|
4184
|
+
id: string;
|
|
4185
|
+
slug: string;
|
|
4186
|
+
displayName: string;
|
|
4187
|
+
description?: string | null;
|
|
4188
|
+
imageUrl?: string | null;
|
|
4189
|
+
isPlaceable: boolean;
|
|
4190
|
+
metadata?: PlaceableItemMetadata | null;
|
|
2517
4191
|
};
|
|
4192
|
+
};
|
|
4193
|
+
/**
|
|
4194
|
+
* Game custom hostname with validation records
|
|
4195
|
+
*/
|
|
4196
|
+
type GameCustomHostname = GameCustomHostnameRow & {
|
|
4197
|
+
validationRecords?: DomainValidationRecords;
|
|
4198
|
+
};
|
|
4199
|
+
|
|
4200
|
+
type UserLevelRow = typeof userLevels.$inferSelect;
|
|
4201
|
+
type LevelConfigRow = typeof levelConfigs.$inferSelect;
|
|
4202
|
+
type UserLevelWithConfig = UserLevelRow & {
|
|
4203
|
+
xpToNextLevel: number;
|
|
4204
|
+
nextLevelConfig?: LevelConfigRow;
|
|
4205
|
+
};
|
|
4206
|
+
|
|
4207
|
+
type SpriteTemplateRow = typeof spriteTemplates.$inferSelect;
|
|
4208
|
+
|
|
4209
|
+
type NotificationRow = InferSelectModel<typeof notifications>;
|
|
4210
|
+
|
|
4211
|
+
/**
|
|
4212
|
+
* Level & Progression Types
|
|
4213
|
+
*
|
|
4214
|
+
* API response DTOs for level system. Database row types are in @playcademy/data/types.
|
|
4215
|
+
*
|
|
4216
|
+
* @module types/level
|
|
4217
|
+
*/
|
|
4218
|
+
/**
|
|
4219
|
+
* Result of adding XP to a user.
|
|
4220
|
+
*/
|
|
4221
|
+
interface XPAddResult {
|
|
4222
|
+
totalXP: number;
|
|
4223
|
+
newLevel: number;
|
|
4224
|
+
leveledUp: boolean;
|
|
4225
|
+
creditsAwarded: number;
|
|
4226
|
+
xpToNextLevel: number;
|
|
4227
|
+
}
|
|
4228
|
+
/**
|
|
4229
|
+
* Result of checking whether a level up occurred.
|
|
4230
|
+
*/
|
|
4231
|
+
interface LevelUpCheckResult {
|
|
4232
|
+
newLevel: number;
|
|
4233
|
+
remainingXp: number;
|
|
4234
|
+
leveledUp: boolean;
|
|
4235
|
+
creditsAwarded: number;
|
|
4236
|
+
xpToNextLevel: number;
|
|
4237
|
+
}
|
|
4238
|
+
/**
|
|
4239
|
+
* Level progress API response.
|
|
4240
|
+
*/
|
|
4241
|
+
interface LevelProgressResponse {
|
|
4242
|
+
level: number;
|
|
4243
|
+
currentXp: number;
|
|
4244
|
+
xpToNextLevel: number;
|
|
4245
|
+
totalXP: number;
|
|
4246
|
+
}
|
|
4247
|
+
|
|
4248
|
+
/**
|
|
4249
|
+
* Shop Types
|
|
4250
|
+
*
|
|
4251
|
+
* @module types/shop
|
|
4252
|
+
*/
|
|
4253
|
+
/**
|
|
4254
|
+
* Currency display info for shop UI.
|
|
4255
|
+
*/
|
|
4256
|
+
interface ShopCurrency {
|
|
4257
|
+
id: string;
|
|
4258
|
+
symbol: string | null;
|
|
4259
|
+
isPrimary: boolean;
|
|
4260
|
+
displayName?: string | null;
|
|
4261
|
+
imageUrl?: string | null;
|
|
2518
4262
|
}
|
|
2519
4263
|
/**
|
|
2520
|
-
* Shop
|
|
2521
|
-
*
|
|
4264
|
+
* Shop item for display.
|
|
4265
|
+
* Combines Item fields (excluding createdAt) with shop listing data.
|
|
2522
4266
|
*/
|
|
2523
|
-
interface ShopDisplayItem
|
|
4267
|
+
interface ShopDisplayItem {
|
|
4268
|
+
id: string;
|
|
4269
|
+
slug: string;
|
|
4270
|
+
gameId?: string | null;
|
|
4271
|
+
displayName: string;
|
|
4272
|
+
description?: string | null;
|
|
4273
|
+
type: string;
|
|
4274
|
+
isPlaceable: boolean;
|
|
4275
|
+
imageUrl?: string | null;
|
|
4276
|
+
metadata?: unknown;
|
|
2524
4277
|
listingId: string;
|
|
2525
4278
|
shopPrice: number;
|
|
2526
4279
|
currencyId: string;
|
|
@@ -2530,65 +4283,33 @@ interface ShopDisplayItem extends Omit<Item, 'createdAt'> {
|
|
|
2530
4283
|
stock?: number | null;
|
|
2531
4284
|
sellBackPercentage?: number | null;
|
|
2532
4285
|
}
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
isPrimary: boolean;
|
|
2537
|
-
displayName?: string | null;
|
|
2538
|
-
imageUrl?: string | null;
|
|
2539
|
-
}
|
|
4286
|
+
/**
|
|
4287
|
+
* Complete shop view response.
|
|
4288
|
+
*/
|
|
2540
4289
|
interface ShopViewResponse {
|
|
2541
4290
|
shopItems: ShopDisplayItem[];
|
|
2542
4291
|
currencies: ShopCurrency[];
|
|
2543
4292
|
}
|
|
4293
|
+
|
|
2544
4294
|
/**
|
|
2545
|
-
*
|
|
2546
|
-
*
|
|
4295
|
+
* Sprite Types
|
|
4296
|
+
*
|
|
4297
|
+
* JSON shapes for sprite configuration. Database row types are in @playcademy/data/types.
|
|
4298
|
+
*
|
|
4299
|
+
* @module types/sprite
|
|
2547
4300
|
*/
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
gameId: string;
|
|
2557
|
-
gameTitle: string;
|
|
2558
|
-
gameSlug: string;
|
|
2559
|
-
}
|
|
2560
|
-
|
|
2561
|
-
type UserLevel = typeof userLevels.$inferSelect;
|
|
2562
|
-
type LevelConfig = typeof levelConfigs.$inferSelect;
|
|
2563
|
-
type UserLevelWithConfig = UserLevel & {
|
|
2564
|
-
xpToNextLevel: number;
|
|
2565
|
-
nextLevelConfig?: LevelConfig;
|
|
2566
|
-
};
|
|
2567
|
-
interface LeaderboardEntry {
|
|
2568
|
-
rank: number;
|
|
2569
|
-
userId: string;
|
|
2570
|
-
username: string;
|
|
2571
|
-
userImage?: string | null;
|
|
2572
|
-
score: number;
|
|
2573
|
-
achievedAt: Date;
|
|
2574
|
-
metadata?: Record<string, unknown>;
|
|
2575
|
-
gameId?: string;
|
|
2576
|
-
gameTitle?: string;
|
|
2577
|
-
gameSlug?: string;
|
|
2578
|
-
}
|
|
2579
|
-
interface UserRank {
|
|
2580
|
-
rank: number;
|
|
2581
|
-
totalPlayers: number;
|
|
2582
|
-
score: number;
|
|
2583
|
-
percentile: number;
|
|
2584
|
-
}
|
|
2585
|
-
interface UserRankResponse {
|
|
2586
|
-
rank: number;
|
|
2587
|
-
score: number;
|
|
2588
|
-
userId: string;
|
|
4301
|
+
/**
|
|
4302
|
+
* Animation frame configuration.
|
|
4303
|
+
*/
|
|
4304
|
+
interface SpriteAnimationFrame {
|
|
4305
|
+
row: number;
|
|
4306
|
+
frameStart: number;
|
|
4307
|
+
numFrames: number;
|
|
4308
|
+
fps: number;
|
|
2589
4309
|
}
|
|
2590
|
-
|
|
2591
|
-
|
|
4310
|
+
/**
|
|
4311
|
+
* Sprite template data structure (stored in JSONB).
|
|
4312
|
+
*/
|
|
2592
4313
|
interface SpriteTemplateData {
|
|
2593
4314
|
tileSize: number;
|
|
2594
4315
|
tileHeight: number;
|
|
@@ -2596,115 +4317,31 @@ interface SpriteTemplateData {
|
|
|
2596
4317
|
rows: number;
|
|
2597
4318
|
spacing: number;
|
|
2598
4319
|
animations: {
|
|
2599
|
-
base_right:
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
base_left: {
|
|
2612
|
-
row: number;
|
|
2613
|
-
frameStart: number;
|
|
2614
|
-
numFrames: number;
|
|
2615
|
-
fps: number;
|
|
2616
|
-
};
|
|
2617
|
-
base_down: {
|
|
2618
|
-
row: number;
|
|
2619
|
-
frameStart: number;
|
|
2620
|
-
numFrames: number;
|
|
2621
|
-
fps: number;
|
|
2622
|
-
};
|
|
2623
|
-
idle_right: {
|
|
2624
|
-
row: number;
|
|
2625
|
-
frameStart: number;
|
|
2626
|
-
numFrames: number;
|
|
2627
|
-
fps: number;
|
|
2628
|
-
};
|
|
2629
|
-
walk_right: {
|
|
2630
|
-
row: number;
|
|
2631
|
-
frameStart: number;
|
|
2632
|
-
numFrames: number;
|
|
2633
|
-
fps: number;
|
|
2634
|
-
};
|
|
2635
|
-
idle_up: {
|
|
2636
|
-
row: number;
|
|
2637
|
-
frameStart: number;
|
|
2638
|
-
numFrames: number;
|
|
2639
|
-
fps: number;
|
|
2640
|
-
};
|
|
2641
|
-
walk_up: {
|
|
2642
|
-
row: number;
|
|
2643
|
-
frameStart: number;
|
|
2644
|
-
numFrames: number;
|
|
2645
|
-
fps: number;
|
|
2646
|
-
};
|
|
2647
|
-
idle_left: {
|
|
2648
|
-
row: number;
|
|
2649
|
-
frameStart: number;
|
|
2650
|
-
numFrames: number;
|
|
2651
|
-
fps: number;
|
|
2652
|
-
};
|
|
2653
|
-
walk_left: {
|
|
2654
|
-
row: number;
|
|
2655
|
-
frameStart: number;
|
|
2656
|
-
numFrames: number;
|
|
2657
|
-
fps: number;
|
|
2658
|
-
};
|
|
2659
|
-
idle_down: {
|
|
2660
|
-
row: number;
|
|
2661
|
-
frameStart: number;
|
|
2662
|
-
numFrames: number;
|
|
2663
|
-
fps: number;
|
|
2664
|
-
};
|
|
2665
|
-
walk_down: {
|
|
2666
|
-
row: number;
|
|
2667
|
-
frameStart: number;
|
|
2668
|
-
numFrames: number;
|
|
2669
|
-
fps: number;
|
|
2670
|
-
};
|
|
4320
|
+
base_right: SpriteAnimationFrame;
|
|
4321
|
+
base_up: SpriteAnimationFrame;
|
|
4322
|
+
base_left: SpriteAnimationFrame;
|
|
4323
|
+
base_down: SpriteAnimationFrame;
|
|
4324
|
+
idle_right: SpriteAnimationFrame;
|
|
4325
|
+
walk_right: SpriteAnimationFrame;
|
|
4326
|
+
idle_up: SpriteAnimationFrame;
|
|
4327
|
+
walk_up: SpriteAnimationFrame;
|
|
4328
|
+
idle_left: SpriteAnimationFrame;
|
|
4329
|
+
walk_left: SpriteAnimationFrame;
|
|
4330
|
+
idle_down: SpriteAnimationFrame;
|
|
4331
|
+
walk_down: SpriteAnimationFrame;
|
|
2671
4332
|
};
|
|
2672
|
-
}
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
}>;
|
|
2685
|
-
};
|
|
2686
|
-
/**
|
|
2687
|
-
* Minimal course configuration for TimeBack integration (used in user-facing config).
|
|
2688
|
-
*
|
|
2689
|
-
* NOTE: Per-course overrides (title, courseCode, level, metadata) are defined
|
|
2690
|
-
* in @playcademy/sdk/server as TimebackCourseConfigWithOverrides.
|
|
2691
|
-
* This base type only includes the minimal required fields.
|
|
2692
|
-
*
|
|
2693
|
-
* For totalXp, use metadata.metrics.totalXp (aligns with upstream TimeBack structure).
|
|
2694
|
-
*/
|
|
2695
|
-
type TimebackCourseConfig = {
|
|
2696
|
-
subject: string;
|
|
2697
|
-
grade: number;
|
|
2698
|
-
};
|
|
2699
|
-
type EndActivityResponse = {
|
|
2700
|
-
status: 'ok';
|
|
2701
|
-
courseId: string;
|
|
2702
|
-
xpAwarded: number;
|
|
2703
|
-
masteredUnits?: number;
|
|
2704
|
-
pctCompleteApp?: number;
|
|
2705
|
-
scoreStatus?: string;
|
|
2706
|
-
inProgress?: string;
|
|
2707
|
-
};
|
|
4333
|
+
}
|
|
4334
|
+
/**
|
|
4335
|
+
* Sprite sheet configuration with precomputed dimensions.
|
|
4336
|
+
*/
|
|
4337
|
+
interface SpriteConfigWithDimensions {
|
|
4338
|
+
textureUrl: string;
|
|
4339
|
+
columns: number;
|
|
4340
|
+
rows: number;
|
|
4341
|
+
spriteWidth: number;
|
|
4342
|
+
spriteHeight: number;
|
|
4343
|
+
animations: Record<string, SpriteAnimationFrame>;
|
|
4344
|
+
}
|
|
2708
4345
|
|
|
2709
4346
|
/**
|
|
2710
4347
|
* Connection monitoring types
|
|
@@ -2720,6 +4357,180 @@ type EndActivityResponse = {
|
|
|
2720
4357
|
*/
|
|
2721
4358
|
type ConnectionState = 'online' | 'offline' | 'degraded';
|
|
2722
4359
|
|
|
4360
|
+
/**
|
|
4361
|
+
* Connection Manager
|
|
4362
|
+
*
|
|
4363
|
+
* Manages connection monitoring and integrates it with the Playcademy client.
|
|
4364
|
+
* Handles event wiring, state management, and disconnect callbacks.
|
|
4365
|
+
*
|
|
4366
|
+
* In iframe mode, disables local monitoring and listens to platform connection
|
|
4367
|
+
* state broadcasts instead (avoids duplicate heartbeats).
|
|
4368
|
+
*/
|
|
4369
|
+
|
|
4370
|
+
/**
|
|
4371
|
+
* Configuration for the ConnectionManager.
|
|
4372
|
+
*/
|
|
4373
|
+
interface ConnectionManagerConfig {
|
|
4374
|
+
/** Base URL for API requests (used for heartbeat pings) */
|
|
4375
|
+
baseUrl: string;
|
|
4376
|
+
/** Authentication context (iframe vs standalone) for alert routing */
|
|
4377
|
+
authContext?: {
|
|
4378
|
+
isInIframe: boolean;
|
|
4379
|
+
};
|
|
4380
|
+
/** Handler to call when connection issues are detected */
|
|
4381
|
+
onDisconnect?: DisconnectHandler;
|
|
4382
|
+
/** Callback to emit connection change events to the client */
|
|
4383
|
+
onConnectionChange?: (state: ConnectionState, reason: string) => void;
|
|
4384
|
+
}
|
|
4385
|
+
/**
|
|
4386
|
+
* Manages connection monitoring for the Playcademy client.
|
|
4387
|
+
*
|
|
4388
|
+
* The ConnectionManager serves as an integration layer between the low-level
|
|
4389
|
+
* ConnectionMonitor and the PlaycademyClient. It handles:
|
|
4390
|
+
* - Event wiring and coordination
|
|
4391
|
+
* - Disconnect callbacks with context
|
|
4392
|
+
* - Platform-level alert integration
|
|
4393
|
+
* - Request success/failure tracking
|
|
4394
|
+
*
|
|
4395
|
+
* This class is used internally by PlaycademyClient and typically not
|
|
4396
|
+
* instantiated directly by game developers.
|
|
4397
|
+
*
|
|
4398
|
+
* @see {@link ConnectionMonitor} for the underlying monitoring implementation
|
|
4399
|
+
* @see {@link PlaycademyClient.onDisconnect} for the public API
|
|
4400
|
+
*/
|
|
4401
|
+
declare class ConnectionManager {
|
|
4402
|
+
private monitor?;
|
|
4403
|
+
private authContext?;
|
|
4404
|
+
private disconnectHandler?;
|
|
4405
|
+
private connectionChangeCallback?;
|
|
4406
|
+
private currentState;
|
|
4407
|
+
private additionalDisconnectHandlers;
|
|
4408
|
+
/**
|
|
4409
|
+
* Creates a new ConnectionManager instance.
|
|
4410
|
+
*
|
|
4411
|
+
* @param config - Configuration options for the manager
|
|
4412
|
+
*
|
|
4413
|
+
* @example
|
|
4414
|
+
* ```typescript
|
|
4415
|
+
* const manager = new ConnectionManager({
|
|
4416
|
+
* baseUrl: 'https://api.playcademy.com',
|
|
4417
|
+
* authContext: { isInIframe: false },
|
|
4418
|
+
* onDisconnect: (context) => {
|
|
4419
|
+
* console.log(`Disconnected: ${context.state}`)
|
|
4420
|
+
* },
|
|
4421
|
+
* onConnectionChange: (state, reason) => {
|
|
4422
|
+
* console.log(`Connection changed: ${state}`)
|
|
4423
|
+
* }
|
|
4424
|
+
* })
|
|
4425
|
+
* ```
|
|
4426
|
+
*/
|
|
4427
|
+
constructor(config: ConnectionManagerConfig);
|
|
4428
|
+
/**
|
|
4429
|
+
* Gets the current connection state.
|
|
4430
|
+
*
|
|
4431
|
+
* @returns The current connection state ('online', 'offline', or 'degraded')
|
|
4432
|
+
*
|
|
4433
|
+
* @example
|
|
4434
|
+
* ```typescript
|
|
4435
|
+
* const state = manager.getState()
|
|
4436
|
+
* if (state === 'offline') {
|
|
4437
|
+
* console.log('No connection')
|
|
4438
|
+
* }
|
|
4439
|
+
* ```
|
|
4440
|
+
*/
|
|
4441
|
+
getState(): ConnectionState;
|
|
4442
|
+
/**
|
|
4443
|
+
* Manually triggers a connection check immediately.
|
|
4444
|
+
*
|
|
4445
|
+
* Forces a heartbeat ping to verify the current connection status.
|
|
4446
|
+
* Useful when you need to check connectivity before a critical operation.
|
|
4447
|
+
*
|
|
4448
|
+
* In iframe mode, this returns the last known state from platform.
|
|
4449
|
+
*
|
|
4450
|
+
* @returns Promise resolving to the current connection state
|
|
4451
|
+
*
|
|
4452
|
+
* @example
|
|
4453
|
+
* ```typescript
|
|
4454
|
+
* const state = await manager.checkNow()
|
|
4455
|
+
* if (state === 'online') {
|
|
4456
|
+
* await performCriticalOperation()
|
|
4457
|
+
* }
|
|
4458
|
+
* ```
|
|
4459
|
+
*/
|
|
4460
|
+
checkNow(): Promise<ConnectionState>;
|
|
4461
|
+
/**
|
|
4462
|
+
* Reports a successful API request to the connection monitor.
|
|
4463
|
+
*
|
|
4464
|
+
* This resets the consecutive failure counter and transitions from
|
|
4465
|
+
* 'degraded' to 'online' state if applicable.
|
|
4466
|
+
*
|
|
4467
|
+
* Typically called automatically by the SDK's request wrapper.
|
|
4468
|
+
* No-op in iframe mode (platform handles monitoring).
|
|
4469
|
+
*/
|
|
4470
|
+
reportRequestSuccess(): void;
|
|
4471
|
+
/**
|
|
4472
|
+
* Reports a failed API request to the connection monitor.
|
|
4473
|
+
*
|
|
4474
|
+
* Only network errors are tracked (not 4xx/5xx HTTP responses).
|
|
4475
|
+
* After consecutive failures exceed the threshold, the state transitions
|
|
4476
|
+
* to 'degraded' or 'offline'.
|
|
4477
|
+
*
|
|
4478
|
+
* Typically called automatically by the SDK's request wrapper.
|
|
4479
|
+
* No-op in iframe mode (platform handles monitoring).
|
|
4480
|
+
*
|
|
4481
|
+
* @param error - The error from the failed request
|
|
4482
|
+
*/
|
|
4483
|
+
reportRequestFailure(error: unknown): void;
|
|
4484
|
+
/**
|
|
4485
|
+
* Registers a callback to be called when connection issues are detected.
|
|
4486
|
+
*
|
|
4487
|
+
* The callback only fires for 'offline' and 'degraded' states, not when
|
|
4488
|
+
* recovering to 'online'. This provides a clean API for games to handle
|
|
4489
|
+
* disconnect scenarios without being notified of every state change.
|
|
4490
|
+
*
|
|
4491
|
+
* Works in both iframe and standalone modes transparently.
|
|
4492
|
+
*
|
|
4493
|
+
* @param callback - Function to call when connection degrades
|
|
4494
|
+
* @returns Cleanup function to unregister the callback
|
|
4495
|
+
*
|
|
4496
|
+
* @example
|
|
4497
|
+
* ```typescript
|
|
4498
|
+
* const cleanup = manager.onDisconnect(({ state, reason, displayAlert }) => {
|
|
4499
|
+
* if (state === 'offline') {
|
|
4500
|
+
* displayAlert?.('Connection lost. Saving your progress...', { type: 'error' })
|
|
4501
|
+
* saveGameState()
|
|
4502
|
+
* }
|
|
4503
|
+
* })
|
|
4504
|
+
*
|
|
4505
|
+
* // Later: cleanup() to unregister
|
|
4506
|
+
* ```
|
|
4507
|
+
*/
|
|
4508
|
+
onDisconnect(callback: DisconnectHandler): () => void;
|
|
4509
|
+
/**
|
|
4510
|
+
* Stops connection monitoring and performs cleanup.
|
|
4511
|
+
*
|
|
4512
|
+
* Removes event listeners and clears heartbeat intervals.
|
|
4513
|
+
* Should be called when the client is being destroyed.
|
|
4514
|
+
*/
|
|
4515
|
+
stop(): void;
|
|
4516
|
+
/**
|
|
4517
|
+
* Sets up listener for platform connection state broadcasts (iframe mode only).
|
|
4518
|
+
*/
|
|
4519
|
+
private _setupPlatformListener;
|
|
4520
|
+
/**
|
|
4521
|
+
* Handles connection state changes from the monitor or platform.
|
|
4522
|
+
*
|
|
4523
|
+
* Coordinates between:
|
|
4524
|
+
* 1. Emitting events to the client (for client.on('connectionChange'))
|
|
4525
|
+
* 2. Calling the disconnect handler if configured
|
|
4526
|
+
* 3. Calling any additional handlers registered via onDisconnect()
|
|
4527
|
+
*
|
|
4528
|
+
* @param state - The new connection state
|
|
4529
|
+
* @param reason - Human-readable reason for the state change
|
|
4530
|
+
*/
|
|
4531
|
+
private _handleConnectionChange;
|
|
4532
|
+
}
|
|
4533
|
+
|
|
2723
4534
|
/**
|
|
2724
4535
|
* @fileoverview Playcademy Messaging System
|
|
2725
4536
|
*
|
|
@@ -2931,208 +4742,103 @@ declare function init<T extends PlaycademyClient = PlaycademyClient>(this: new (
|
|
|
2931
4742
|
*/
|
|
2932
4743
|
declare function login(baseUrl: string, email: string, password: string): Promise<LoginResponse>;
|
|
2933
4744
|
|
|
2934
|
-
/**
|
|
2935
|
-
|
|
4745
|
+
/**
|
|
4746
|
+
* @fileoverview Authentication Strategy Pattern
|
|
4747
|
+
*
|
|
4748
|
+
* Provides different authentication strategies for the Playcademy SDK.
|
|
4749
|
+
* Each strategy knows how to add its authentication headers to requests.
|
|
4750
|
+
*/
|
|
2936
4751
|
|
|
2937
4752
|
/**
|
|
2938
|
-
*
|
|
2939
|
-
* Provides namespaced access to all platform features including games, users, inventory, and more.
|
|
4753
|
+
* Base interface for authentication strategies
|
|
2940
4754
|
*/
|
|
2941
|
-
|
|
4755
|
+
interface AuthStrategy {
|
|
4756
|
+
/** Get the token value */
|
|
4757
|
+
getToken(): string | null;
|
|
4758
|
+
/** Get the token type */
|
|
4759
|
+
getType(): TokenType;
|
|
4760
|
+
/** Get authentication headers for a request */
|
|
4761
|
+
getHeaders(): Record<string, string>;
|
|
4762
|
+
}
|
|
4763
|
+
|
|
4764
|
+
/**
|
|
4765
|
+
* Base Playcademy SDK client with shared infrastructure.
|
|
4766
|
+
* Provides authentication, HTTP requests, events, connection monitoring,
|
|
4767
|
+
* and fundamental namespaces used by all clients.
|
|
4768
|
+
*
|
|
4769
|
+
* Extended by PlaycademyClient (game SDK) and PlaycademyInternalClient (platform SDK).
|
|
4770
|
+
*/
|
|
4771
|
+
declare abstract class PlaycademyBaseClient {
|
|
2942
4772
|
baseUrl: string;
|
|
2943
4773
|
gameUrl?: string;
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
4774
|
+
protected authStrategy: AuthStrategy;
|
|
4775
|
+
protected gameId?: string;
|
|
4776
|
+
protected config: Partial<ClientConfig>;
|
|
4777
|
+
protected listeners: EventListeners;
|
|
4778
|
+
protected internalClientSessionId?: string;
|
|
4779
|
+
protected authContext?: {
|
|
4780
|
+
isInIframe: boolean;
|
|
4781
|
+
};
|
|
4782
|
+
protected initPayload?: InitPayload;
|
|
4783
|
+
protected connectionManager?: ConnectionManager;
|
|
2952
4784
|
/**
|
|
2953
4785
|
* Internal session manager for automatic session lifecycle.
|
|
2954
|
-
*
|
|
2955
|
-
* This manager handles starting and ending game sessions automatically.
|
|
2956
|
-
* Game developers don't need to call these methods directly - they're managed
|
|
2957
|
-
* by the SDK during initialization and cleanup.
|
|
2958
|
-
*
|
|
2959
4786
|
* @private
|
|
2960
4787
|
* @internal
|
|
2961
4788
|
*/
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
* @param config.token - Authentication token
|
|
2969
|
-
* @param config.tokenType - Optional token type (auto-detected if not provided)
|
|
2970
|
-
* @param config.gameId - Game ID for automatic session management
|
|
2971
|
-
* @param config.autoStartSession - Automatically start a game session?
|
|
2972
|
-
*/
|
|
4789
|
+
protected _sessionManager: {
|
|
4790
|
+
startSession: (gameId: string) => Promise<{
|
|
4791
|
+
sessionId: string;
|
|
4792
|
+
}>;
|
|
4793
|
+
endSession: (sessionId: string, gameId: string) => Promise<void>;
|
|
4794
|
+
};
|
|
2973
4795
|
constructor(config?: Partial<ClientConfig>);
|
|
2974
4796
|
/**
|
|
2975
4797
|
* Gets the effective base URL for API requests.
|
|
2976
|
-
* Converts relative URLs to absolute URLs in browser environments.
|
|
2977
|
-
* Note: baseUrl already includes /api suffix from constructor.
|
|
2978
|
-
*
|
|
2979
|
-
* @returns The complete base URL for API requests (with /api suffix)
|
|
2980
4798
|
*/
|
|
2981
4799
|
getBaseUrl(): string;
|
|
2982
4800
|
/**
|
|
2983
4801
|
* Gets the effective game backend URL for integration requests.
|
|
2984
|
-
* Throws if gameUrl is not configured.
|
|
2985
|
-
*
|
|
2986
|
-
* @returns The complete game backend URL for API requests (with /api suffix)
|
|
2987
|
-
* @throws PlaycademyError if gameUrl is not set
|
|
2988
4802
|
*/
|
|
2989
|
-
|
|
4803
|
+
protected getGameBackendUrl(): string;
|
|
2990
4804
|
/**
|
|
2991
4805
|
* Simple ping method for testing connectivity.
|
|
2992
|
-
*
|
|
2993
|
-
* @returns 'pong' string response
|
|
2994
4806
|
*/
|
|
2995
4807
|
ping(): string;
|
|
2996
4808
|
/**
|
|
2997
4809
|
* Sets the authentication token for API requests.
|
|
2998
|
-
* Emits an 'authChange' event when the token changes.
|
|
2999
|
-
*
|
|
3000
|
-
* @param token - The authentication token, or null to clear
|
|
3001
|
-
* @param tokenType - Optional token type (auto-detected if not provided)
|
|
3002
4810
|
*/
|
|
3003
4811
|
setToken(token: string | null, tokenType?: TokenType): void;
|
|
3004
4812
|
/**
|
|
3005
4813
|
* Gets the current token type.
|
|
3006
|
-
*
|
|
3007
|
-
* @returns The token type
|
|
3008
4814
|
*/
|
|
3009
4815
|
getTokenType(): TokenType;
|
|
3010
4816
|
/**
|
|
3011
4817
|
* Gets the current authentication token.
|
|
3012
|
-
*
|
|
3013
|
-
* @returns The current token or null if not authenticated
|
|
3014
|
-
*
|
|
3015
|
-
* @example
|
|
3016
|
-
* ```typescript
|
|
3017
|
-
* // Send token to your backend for verification
|
|
3018
|
-
* const token = client.getToken()
|
|
3019
|
-
* const response = await fetch('/api/auth/playcademy', {
|
|
3020
|
-
* method: 'POST',
|
|
3021
|
-
* body: JSON.stringify({ gameToken: token })
|
|
3022
|
-
* })
|
|
3023
|
-
* ```
|
|
3024
4818
|
*/
|
|
3025
4819
|
getToken(): string | null;
|
|
3026
4820
|
/**
|
|
3027
|
-
* Checks if the client has a valid API token
|
|
3028
|
-
*
|
|
3029
|
-
* For games (iframe context): Checks if we have a valid token from the parent.
|
|
3030
|
-
* For Cademy (standalone): Checks if we have a token from better-auth.
|
|
3031
|
-
*
|
|
3032
|
-
* Note: This checks for API authentication, not whether a user has linked
|
|
3033
|
-
* their identity via OAuth.
|
|
3034
|
-
*
|
|
3035
|
-
* @returns true if API token exists, false otherwise
|
|
3036
|
-
*
|
|
3037
|
-
* @example
|
|
3038
|
-
* ```typescript
|
|
3039
|
-
* if (client.isAuthenticated()) {
|
|
3040
|
-
* // Can make API calls
|
|
3041
|
-
* const games = await client.games.list()
|
|
3042
|
-
* } else {
|
|
3043
|
-
* console.error('No API token available')
|
|
3044
|
-
* }
|
|
3045
|
-
* ```
|
|
4821
|
+
* Checks if the client has a valid API token.
|
|
3046
4822
|
*/
|
|
3047
4823
|
isAuthenticated(): boolean;
|
|
3048
4824
|
/**
|
|
3049
4825
|
* Registers a callback to be called when authentication state changes.
|
|
3050
|
-
*
|
|
3051
|
-
* @param callback - Function to call when auth state changes
|
|
3052
4826
|
*/
|
|
3053
4827
|
onAuthChange(callback: (token: string | null) => void): void;
|
|
3054
4828
|
/**
|
|
3055
4829
|
* Registers a callback to be called when connection issues are detected.
|
|
3056
|
-
*
|
|
3057
|
-
* This is a convenience method that filters connection change events to only
|
|
3058
|
-
* fire when the connection degrades (offline or degraded states). Use this
|
|
3059
|
-
* when you want to handle disconnects without being notified of recoveries.
|
|
3060
|
-
*
|
|
3061
|
-
* For all connection state changes, use `client.on('connectionChange', ...)` instead.
|
|
3062
|
-
*
|
|
3063
|
-
* @param callback - Function to call when connection state changes to offline or degraded
|
|
3064
|
-
* @returns Cleanup function to unregister the callback
|
|
3065
|
-
*
|
|
3066
|
-
* @example
|
|
3067
|
-
* ```typescript
|
|
3068
|
-
* const cleanup = client.onDisconnect(({ state, reason, displayAlert }) => {
|
|
3069
|
-
* console.log(`Connection ${state}: ${reason}`)
|
|
3070
|
-
*
|
|
3071
|
-
* if (state === 'offline') {
|
|
3072
|
-
* // Save state and return to game lobby
|
|
3073
|
-
* displayAlert?.('Connection lost. Your progress has been saved.', { type: 'error' })
|
|
3074
|
-
* saveGameState()
|
|
3075
|
-
* returnToLobby()
|
|
3076
|
-
* } else if (state === 'degraded') {
|
|
3077
|
-
* displayAlert?.('Slow connection detected.', { type: 'warning' })
|
|
3078
|
-
* }
|
|
3079
|
-
* })
|
|
3080
|
-
*
|
|
3081
|
-
* // Later: cleanup() to unregister
|
|
3082
|
-
* ```
|
|
3083
|
-
*
|
|
3084
|
-
* @see Connection monitoring documentation in SDK Browser docs for detailed usage examples
|
|
3085
|
-
* @see {@link ConnectionManager.onDisconnect} for the underlying implementation
|
|
3086
4830
|
*/
|
|
3087
4831
|
onDisconnect(callback: (context: DisconnectContext) => void | Promise<void>): () => void;
|
|
3088
4832
|
/**
|
|
3089
4833
|
* Gets the current connection state.
|
|
3090
|
-
*
|
|
3091
|
-
* Returns the last known connection state without triggering a new check.
|
|
3092
|
-
* Use `checkConnection()` to force an immediate verification.
|
|
3093
|
-
*
|
|
3094
|
-
* @returns Current connection state ('online', 'offline', 'degraded') or 'unknown' if monitoring is disabled
|
|
3095
|
-
*
|
|
3096
|
-
* @example
|
|
3097
|
-
* ```typescript
|
|
3098
|
-
* const state = client.getConnectionState()
|
|
3099
|
-
* if (state === 'offline') {
|
|
3100
|
-
* console.log('No connection available')
|
|
3101
|
-
* }
|
|
3102
|
-
* ```
|
|
3103
|
-
*
|
|
3104
|
-
* @see {@link checkConnection} to trigger an immediate connection check
|
|
3105
|
-
* @see {@link ConnectionManager.getState} for the underlying implementation
|
|
3106
4834
|
*/
|
|
3107
4835
|
getConnectionState(): ConnectionState | 'unknown';
|
|
3108
4836
|
/**
|
|
3109
4837
|
* Manually triggers a connection check immediately.
|
|
3110
|
-
*
|
|
3111
|
-
* Forces a heartbeat ping to verify connectivity right now, bypassing the normal
|
|
3112
|
-
* interval. Useful when you need to verify connection status before a critical
|
|
3113
|
-
* operation (e.g., saving important game state).
|
|
3114
|
-
*
|
|
3115
|
-
* @returns Promise resolving to the current connection state after verification
|
|
3116
|
-
*
|
|
3117
|
-
* @example
|
|
3118
|
-
* ```typescript
|
|
3119
|
-
* // Check before critical operation
|
|
3120
|
-
* const state = await client.checkConnection()
|
|
3121
|
-
* if (state !== 'online') {
|
|
3122
|
-
* alert('Please check your internet connection before saving')
|
|
3123
|
-
* return
|
|
3124
|
-
* }
|
|
3125
|
-
*
|
|
3126
|
-
* await client.games.saveState(importantData)
|
|
3127
|
-
* ```
|
|
3128
|
-
*
|
|
3129
|
-
* @see {@link getConnectionState} to get the last known state without checking
|
|
3130
|
-
* @see {@link ConnectionManager.checkNow} for the underlying implementation
|
|
3131
4838
|
*/
|
|
3132
4839
|
checkConnection(): Promise<ConnectionState | 'unknown'>;
|
|
3133
4840
|
/**
|
|
3134
4841
|
* Sets the authentication context for the client.
|
|
3135
|
-
* This is called during initialization to store environment info.
|
|
3136
4842
|
* @internal
|
|
3137
4843
|
*/
|
|
3138
4844
|
_setAuthContext(context: {
|
|
@@ -3140,28 +4846,14 @@ declare class PlaycademyClient {
|
|
|
3140
4846
|
}): void;
|
|
3141
4847
|
/**
|
|
3142
4848
|
* Registers an event listener for client events.
|
|
3143
|
-
*
|
|
3144
|
-
* @param event - The event type to listen for
|
|
3145
|
-
* @param callback - Function to call when the event is emitted
|
|
3146
4849
|
*/
|
|
3147
4850
|
on<E extends keyof ClientEvents>(event: E, callback: (payload: ClientEvents[E]) => void): void;
|
|
3148
4851
|
/**
|
|
3149
4852
|
* Emits an event to all registered listeners.
|
|
3150
|
-
*
|
|
3151
|
-
* @param event - The event type to emit
|
|
3152
|
-
* @param payload - The event payload
|
|
3153
4853
|
*/
|
|
3154
|
-
|
|
4854
|
+
protected emit<E extends keyof ClientEvents>(event: E, payload: ClientEvents[E]): void;
|
|
3155
4855
|
/**
|
|
3156
4856
|
* Makes an authenticated HTTP request to the platform API.
|
|
3157
|
-
*
|
|
3158
|
-
* @param path - API endpoint path
|
|
3159
|
-
* @param method - HTTP method
|
|
3160
|
-
* @param options - Optional request configuration
|
|
3161
|
-
* @param options.body - Request body
|
|
3162
|
-
* @param options.headers - Additional headers
|
|
3163
|
-
* @param options.raw - If true, returns raw Response instead of parsing
|
|
3164
|
-
* @returns Promise resolving to the response data or raw Response
|
|
3165
4857
|
*/
|
|
3166
4858
|
protected request<T>(path: string, method: Method, options?: {
|
|
3167
4859
|
body?: unknown;
|
|
@@ -3170,53 +4862,65 @@ declare class PlaycademyClient {
|
|
|
3170
4862
|
}): Promise<T>;
|
|
3171
4863
|
/**
|
|
3172
4864
|
* Makes an authenticated HTTP request to the game's backend Worker.
|
|
3173
|
-
* Uses gameUrl if set, otherwise falls back to platform API.
|
|
3174
|
-
*
|
|
3175
|
-
* @param path - API endpoint path
|
|
3176
|
-
* @param method - HTTP method
|
|
3177
|
-
* @param body - Request body (optional)
|
|
3178
|
-
* @param headers - Additional headers (optional)
|
|
3179
|
-
* @param raw - If true, returns raw Response instead of parsing (optional)
|
|
3180
|
-
* @returns Promise resolving to the response data or raw Response
|
|
3181
4865
|
*/
|
|
3182
4866
|
protected requestGameBackend<T>(path: string, method: Method, body?: unknown, headers?: Record<string, string>, raw?: boolean): Promise<T>;
|
|
3183
4867
|
/**
|
|
3184
4868
|
* Ensures a gameId is available, throwing an error if not.
|
|
3185
|
-
*
|
|
3186
|
-
* @returns The gameId
|
|
3187
|
-
* @throws PlaycademyError if no gameId is configured
|
|
3188
4869
|
*/
|
|
3189
|
-
|
|
4870
|
+
protected _ensureGameId(): string;
|
|
3190
4871
|
/**
|
|
3191
4872
|
* Detects and sets the authentication context (iframe vs standalone).
|
|
3192
|
-
* Safe to call in any environment - isInIframe handles browser detection.
|
|
3193
4873
|
*/
|
|
3194
4874
|
private _detectAuthContext;
|
|
3195
4875
|
/**
|
|
3196
4876
|
* Initializes connection monitoring if enabled.
|
|
3197
|
-
* Safe to call in any environment - only runs in browser.
|
|
3198
4877
|
*/
|
|
3199
4878
|
private _initializeConnectionMonitor;
|
|
4879
|
+
private _initializeInternalSession;
|
|
3200
4880
|
/**
|
|
3201
|
-
*
|
|
3202
|
-
*
|
|
3203
|
-
*
|
|
3204
|
-
*
|
|
3205
|
-
|
|
4881
|
+
* Current user data and inventory management.
|
|
4882
|
+
* - `me()` - Get authenticated user profile
|
|
4883
|
+
* - `inventory.get()` - List user's items
|
|
4884
|
+
* - `inventory.add(slug, qty)` - Award items to user
|
|
4885
|
+
*/
|
|
4886
|
+
users: {
|
|
4887
|
+
me: () => Promise<AuthenticatedUser>;
|
|
4888
|
+
inventory: {
|
|
4889
|
+
get: () => Promise<InventoryItemWithItem[]>;
|
|
4890
|
+
add: (identifier: string, qty: number) => Promise<InventoryMutationResponse>;
|
|
4891
|
+
remove: (identifier: string, qty: number) => Promise<InventoryMutationResponse>;
|
|
4892
|
+
quantity: (identifier: string) => Promise<number>;
|
|
4893
|
+
has: (identifier: string, minQuantity?: number) => Promise<boolean>;
|
|
4894
|
+
};
|
|
4895
|
+
};
|
|
4896
|
+
}
|
|
4897
|
+
|
|
4898
|
+
/**
|
|
4899
|
+
* Playcademy SDK client for game developers.
|
|
4900
|
+
* Provides namespaced access to platform features for games running inside Cademy.
|
|
4901
|
+
*/
|
|
4902
|
+
declare class PlaycademyClient extends PlaycademyBaseClient {
|
|
4903
|
+
/**
|
|
4904
|
+
* Connect external identity providers to the user's Playcademy account.
|
|
4905
|
+
* - `connect(provider)` - Link Discord, Google, etc. via OAuth popup
|
|
3206
4906
|
*/
|
|
3207
|
-
private _initializeInternalSession;
|
|
3208
|
-
/** Identity provider connection methods (connect external accounts) */
|
|
3209
4907
|
identity: {
|
|
3210
4908
|
connect: (options: AuthOptions) => Promise<AuthResult>;
|
|
3211
4909
|
_getContext: () => {
|
|
3212
4910
|
isInIframe: boolean;
|
|
3213
4911
|
};
|
|
3214
4912
|
};
|
|
3215
|
-
/**
|
|
4913
|
+
/**
|
|
4914
|
+
* Game runtime lifecycle and asset loading.
|
|
4915
|
+
* - `exit()` - Return to Cademy hub
|
|
4916
|
+
* - `getGameToken()` - Get short-lived auth token
|
|
4917
|
+
* - `assets.url()`, `assets.json()`, `assets.fetch()` - Load game assets
|
|
4918
|
+
* - `on('pause')`, `on('resume')` - Handle visibility changes
|
|
4919
|
+
*/
|
|
3216
4920
|
runtime: {
|
|
3217
4921
|
getGameToken: (gameId: string, options?: {
|
|
3218
|
-
apply?: boolean;
|
|
3219
|
-
}) => Promise<GameTokenResponse>;
|
|
4922
|
+
apply?: boolean | undefined;
|
|
4923
|
+
} | undefined) => Promise<GameTokenResponse>;
|
|
3220
4924
|
exit: () => Promise<void>;
|
|
3221
4925
|
onInit: (handler: (context: GameContextPayload) => void) => void;
|
|
3222
4926
|
onTokenRefresh: (handler: (data: {
|
|
@@ -3240,57 +4944,73 @@ declare class PlaycademyClient {
|
|
|
3240
4944
|
getListenerCounts: () => Record<string, number>;
|
|
3241
4945
|
assets: {
|
|
3242
4946
|
url(pathOrStrings: string | TemplateStringsArray, ...values: unknown[]): string;
|
|
3243
|
-
fetch: (path: string, options?: RequestInit) => Promise<Response>;
|
|
4947
|
+
fetch: (path: string, options?: RequestInit | undefined) => Promise<Response>;
|
|
3244
4948
|
json: <T = unknown>(path: string) => Promise<T>;
|
|
3245
4949
|
blob: (path: string) => Promise<Blob>;
|
|
3246
4950
|
text: (path: string) => Promise<string>;
|
|
3247
4951
|
arrayBuffer: (path: string) => Promise<ArrayBuffer>;
|
|
3248
4952
|
};
|
|
3249
4953
|
};
|
|
3250
|
-
/**
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
4954
|
+
/**
|
|
4955
|
+
* TimeBack integration for activity tracking and user context.
|
|
4956
|
+
*
|
|
4957
|
+
* User context (cached from init, refreshable):
|
|
4958
|
+
* - `user.role` - User's role (student, parent, teacher, etc.)
|
|
4959
|
+
* - `user.enrollments` - Courses the player is enrolled in for this game
|
|
4960
|
+
* - `user.organizations` - Schools/districts the player belongs to
|
|
4961
|
+
* - `user.fetch()` - Refresh user context from server
|
|
4962
|
+
*
|
|
4963
|
+
* Activity tracking:
|
|
4964
|
+
* - `startActivity(metadata)` - Begin tracking an activity
|
|
4965
|
+
* - `pauseActivity()` / `resumeActivity()` - Pause/resume timer
|
|
4966
|
+
* - `endActivity(scoreData)` - Submit activity results to TimeBack
|
|
4967
|
+
*/
|
|
3262
4968
|
timeback: {
|
|
3263
|
-
|
|
4969
|
+
readonly user: TimebackUser;
|
|
4970
|
+
startActivity: (metadata: ActivityData) => void;
|
|
3264
4971
|
pauseActivity: () => void;
|
|
3265
4972
|
resumeActivity: () => void;
|
|
3266
|
-
endActivity: (data:
|
|
4973
|
+
endActivity: (data: EndActivityScoreData) => Promise<EndActivityResponse>;
|
|
3267
4974
|
};
|
|
3268
|
-
/**
|
|
4975
|
+
/**
|
|
4976
|
+
* Playcademy Credits (platform currency) management.
|
|
4977
|
+
* - `get()` - Get user's credit balance
|
|
4978
|
+
* - `add(amount)` - Award credits to user
|
|
4979
|
+
*/
|
|
3269
4980
|
credits: {
|
|
3270
4981
|
balance: () => Promise<number>;
|
|
3271
4982
|
add: (amount: number) => Promise<number>;
|
|
3272
4983
|
spend: (amount: number) => Promise<number>;
|
|
3273
4984
|
};
|
|
3274
|
-
/**
|
|
4985
|
+
/**
|
|
4986
|
+
* Game score submission and leaderboards.
|
|
4987
|
+
* - `submit(gameId, score, metadata?)` - Record a game score
|
|
4988
|
+
*/
|
|
3275
4989
|
scores: {
|
|
3276
|
-
submit: (gameId: string, score: number, metadata?: Record<string, unknown>) => Promise<ScoreSubmission>;
|
|
4990
|
+
submit: (gameId: string, score: number, metadata?: Record<string, unknown> | undefined) => Promise<ScoreSubmission>;
|
|
3277
4991
|
};
|
|
3278
|
-
/**
|
|
4992
|
+
/**
|
|
4993
|
+
* Realtime multiplayer authentication.
|
|
4994
|
+
* - `getToken()` - Get token for WebSocket/realtime connections
|
|
4995
|
+
*/
|
|
3279
4996
|
realtime: {
|
|
3280
4997
|
token: {
|
|
3281
4998
|
get: () => Promise<RealtimeTokenResponse>;
|
|
3282
4999
|
};
|
|
3283
|
-
open(channel?: string, url?: string): Promise<_playcademy_realtime_server_types.RealtimeChannel>;
|
|
3284
5000
|
};
|
|
3285
|
-
/**
|
|
5001
|
+
/**
|
|
5002
|
+
* Make requests to your game's custom backend API routes.
|
|
5003
|
+
* - `get(path)`, `post(path, body)`, `put()`, `delete()` - HTTP methods
|
|
5004
|
+
* - Routes are relative to your game's deployment (e.g., '/hello' → your-game.playcademy.gg/api/hello)
|
|
5005
|
+
*/
|
|
3286
5006
|
backend: {
|
|
3287
|
-
get<T = unknown>(path: string, headers?: Record<string, string>): Promise<T>;
|
|
3288
|
-
post<T = unknown>(path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
3289
|
-
put<T = unknown>(path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
3290
|
-
patch<T = unknown>(path: string, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
3291
|
-
delete<T = unknown>(path: string, headers?: Record<string, string>): Promise<T>;
|
|
3292
|
-
request<T = unknown>(path: string, method: Method, body?: unknown, headers?: Record<string, string>): Promise<T>;
|
|
3293
|
-
download(path: string, method?: Method, body?: unknown, headers?: Record<string, string>): Promise<Response>;
|
|
5007
|
+
get<T = unknown>(path: string, headers?: Record<string, string> | undefined): Promise<T>;
|
|
5008
|
+
post<T = unknown>(path: string, body?: unknown, headers?: Record<string, string> | undefined): Promise<T>;
|
|
5009
|
+
put<T = unknown>(path: string, body?: unknown, headers?: Record<string, string> | undefined): Promise<T>;
|
|
5010
|
+
patch<T = unknown>(path: string, body?: unknown, headers?: Record<string, string> | undefined): Promise<T>;
|
|
5011
|
+
delete<T = unknown>(path: string, headers?: Record<string, string> | undefined): Promise<T>;
|
|
5012
|
+
request<T = unknown>(path: string, method: Method, body?: unknown, headers?: Record<string, string> | undefined): Promise<T>;
|
|
5013
|
+
download(path: string, method?: Method, body?: unknown, headers?: Record<string, string> | undefined): Promise<Response>;
|
|
3294
5014
|
url(pathOrStrings: string | TemplateStringsArray, ...values: unknown[]): string;
|
|
3295
5015
|
};
|
|
3296
5016
|
/** Auto-initializes a PlaycademyClient with context from the environment */
|
|
@@ -3303,9 +5023,70 @@ declare class PlaycademyClient {
|
|
|
3303
5023
|
};
|
|
3304
5024
|
}
|
|
3305
5025
|
|
|
5026
|
+
/**
|
|
5027
|
+
* Type definitions for the game timeback namespace.
|
|
5028
|
+
*
|
|
5029
|
+
* SDK-specific types like TimebackInitContext that wrap the core types
|
|
5030
|
+
* from @playcademy/types/user (which are re-exported via types/data.ts).
|
|
5031
|
+
*/
|
|
5032
|
+
|
|
5033
|
+
/**
|
|
5034
|
+
* A TimeBack enrollment for the current game session.
|
|
5035
|
+
* Alias for UserEnrollment without the optional gameId.
|
|
5036
|
+
*/
|
|
5037
|
+
type TimebackEnrollment = Omit<UserEnrollment, 'gameId'>;
|
|
5038
|
+
/**
|
|
5039
|
+
* A TimeBack organization (school/district) for the current user.
|
|
5040
|
+
* Alias for UserOrganization.
|
|
5041
|
+
*/
|
|
5042
|
+
type TimebackOrganization = UserOrganization;
|
|
5043
|
+
/**
|
|
5044
|
+
* TimeBack context passed during game initialization.
|
|
5045
|
+
* This is sent from the platform (cademy) to the game iframe via postMessage.
|
|
5046
|
+
*/
|
|
5047
|
+
interface TimebackInitContext {
|
|
5048
|
+
/** User's TimeBack ID */
|
|
5049
|
+
id: string;
|
|
5050
|
+
/** User's role in TimeBack (student, parent, teacher, etc.) */
|
|
5051
|
+
role: TimebackUserRole;
|
|
5052
|
+
/** User's enrollments for this game (one per grade/subject combo) */
|
|
5053
|
+
enrollments: TimebackEnrollment[];
|
|
5054
|
+
/** User's organizations (schools/districts) */
|
|
5055
|
+
organizations: TimebackOrganization[];
|
|
5056
|
+
}
|
|
5057
|
+
/**
|
|
5058
|
+
* TimeBack user context with current data (may be stale from init).
|
|
5059
|
+
* Use `fetch()` to get fresh data from the server.
|
|
5060
|
+
*/
|
|
5061
|
+
interface TimebackUserContext {
|
|
5062
|
+
/** User's TimeBack ID */
|
|
5063
|
+
id: string | undefined;
|
|
5064
|
+
/** User's role in TimeBack (student, parent, teacher, etc.) */
|
|
5065
|
+
role: TimebackUserRole | undefined;
|
|
5066
|
+
/** User's enrollments for this game */
|
|
5067
|
+
enrollments: TimebackEnrollment[];
|
|
5068
|
+
/** User's organizations (schools/districts) */
|
|
5069
|
+
organizations: TimebackOrganization[];
|
|
5070
|
+
}
|
|
5071
|
+
/**
|
|
5072
|
+
* TimeBack user object with both cached getters and fetch method.
|
|
5073
|
+
*/
|
|
5074
|
+
interface TimebackUser extends TimebackUserContext {
|
|
5075
|
+
/**
|
|
5076
|
+
* Fetch TimeBack data from the server (cached for 5 min).
|
|
5077
|
+
* Updates the cached values so subsequent property access returns fresh data.
|
|
5078
|
+
* @param options - Cache options (pass { force: true } to bypass cache)
|
|
5079
|
+
* @returns Promise resolving to fresh user context
|
|
5080
|
+
*/
|
|
5081
|
+
fetch(options?: {
|
|
5082
|
+
force?: boolean;
|
|
5083
|
+
}): Promise<TimebackUserContext>;
|
|
5084
|
+
}
|
|
5085
|
+
|
|
3306
5086
|
/**
|
|
3307
5087
|
* Core client configuration and lifecycle types
|
|
3308
5088
|
*/
|
|
5089
|
+
|
|
3309
5090
|
type TokenType = 'session' | 'apiKey' | 'gameJwt';
|
|
3310
5091
|
interface ClientConfig {
|
|
3311
5092
|
baseUrl: string;
|
|
@@ -3349,12 +5130,17 @@ interface InitPayload {
|
|
|
3349
5130
|
gameId: string;
|
|
3350
5131
|
/** Realtime WebSocket URL */
|
|
3351
5132
|
realtimeUrl?: string;
|
|
5133
|
+
/** Timeback context (if user has a Timeback account) */
|
|
5134
|
+
timeback?: TimebackInitContext;
|
|
3352
5135
|
}
|
|
3353
5136
|
/**
|
|
3354
5137
|
* Simplified user data passed to games via InitPayload
|
|
3355
5138
|
* This is a subset of AuthenticatedUser suitable for external game consumption
|
|
5139
|
+
*
|
|
5140
|
+
* Note: Named GameInitUser to distinguish from the cross-game GameUser DTO
|
|
5141
|
+
* exported from @playcademy/types
|
|
3356
5142
|
*/
|
|
3357
|
-
interface
|
|
5143
|
+
interface GameInitUser {
|
|
3358
5144
|
/** Playcademy user ID */
|
|
3359
5145
|
id: string;
|
|
3360
5146
|
/** Unique username */
|
|
@@ -3533,19 +5319,6 @@ interface ScoreSubmission {
|
|
|
3533
5319
|
achievedAt: Date;
|
|
3534
5320
|
}
|
|
3535
5321
|
|
|
3536
|
-
/**
|
|
3537
|
-
* Users namespace types
|
|
3538
|
-
*/
|
|
3539
|
-
interface UserScore {
|
|
3540
|
-
id: string;
|
|
3541
|
-
score: number;
|
|
3542
|
-
achievedAt: Date;
|
|
3543
|
-
metadata?: Record<string, unknown>;
|
|
3544
|
-
gameId: string;
|
|
3545
|
-
gameTitle: string;
|
|
3546
|
-
gameSlug: string;
|
|
3547
|
-
}
|
|
3548
|
-
|
|
3549
5322
|
/**
|
|
3550
5323
|
* Authentication namespace types
|
|
3551
5324
|
*/
|
|
@@ -3684,6 +5457,8 @@ type DevUploadEvent = {
|
|
|
3684
5457
|
} | {
|
|
3685
5458
|
type: 'finalizeStatus';
|
|
3686
5459
|
message: string;
|
|
5460
|
+
} | {
|
|
5461
|
+
type: 'complete';
|
|
3687
5462
|
} | {
|
|
3688
5463
|
type: 'close';
|
|
3689
5464
|
};
|
|
@@ -3695,29 +5470,37 @@ type DevUploadHooks = {
|
|
|
3695
5470
|
/**
|
|
3696
5471
|
* Platform TimeBack Types
|
|
3697
5472
|
*
|
|
3698
|
-
* Types for TimeBack
|
|
3699
|
-
*
|
|
5473
|
+
* Types for TimeBack data on the platform side.
|
|
5474
|
+
* Unlike game types, these include gameId for cross-game enrollment views.
|
|
3700
5475
|
*/
|
|
3701
5476
|
|
|
3702
5477
|
/**
|
|
3703
|
-
*
|
|
3704
|
-
*
|
|
5478
|
+
* Platform TimeBack user context.
|
|
5479
|
+
* Unlike game context, enrollments include gameId for cross-game views.
|
|
3705
5480
|
*/
|
|
3706
|
-
interface
|
|
3707
|
-
/**
|
|
3708
|
-
|
|
3709
|
-
/**
|
|
3710
|
-
|
|
3711
|
-
/**
|
|
3712
|
-
|
|
3713
|
-
/**
|
|
3714
|
-
|
|
5481
|
+
interface PlatformTimebackUserContext {
|
|
5482
|
+
/** User's TimeBack ID */
|
|
5483
|
+
id: string | undefined;
|
|
5484
|
+
/** User's role in TimeBack (student, parent, teacher, etc.) */
|
|
5485
|
+
role: TimebackUserRole | undefined;
|
|
5486
|
+
/** User's enrollments across ALL games (includes gameId) */
|
|
5487
|
+
enrollments: UserEnrollment[];
|
|
5488
|
+
/** User's organizations (schools/districts) */
|
|
5489
|
+
organizations: UserOrganization[];
|
|
3715
5490
|
}
|
|
3716
5491
|
/**
|
|
3717
|
-
*
|
|
5492
|
+
* Platform TimeBack user object with both cached getters and fetch method.
|
|
3718
5493
|
*/
|
|
3719
|
-
interface
|
|
3720
|
-
|
|
5494
|
+
interface PlatformTimebackUser extends PlatformTimebackUserContext {
|
|
5495
|
+
/**
|
|
5496
|
+
* Fetch TimeBack data from the server (cached for 5 min).
|
|
5497
|
+
* Updates the cached values so subsequent property access returns fresh data.
|
|
5498
|
+
* @param options - Cache options (pass { force: true } to bypass cache)
|
|
5499
|
+
* @returns Promise resolving to user context with full enrollment data
|
|
5500
|
+
*/
|
|
5501
|
+
fetch(options?: {
|
|
5502
|
+
force?: boolean;
|
|
5503
|
+
}): Promise<PlatformTimebackUserContext>;
|
|
3721
5504
|
}
|
|
3722
5505
|
/**
|
|
3723
5506
|
* Combined response type for xp.summary() method
|
|
@@ -3905,5 +5688,5 @@ interface PlaycademyServerClientState {
|
|
|
3905
5688
|
courseId?: string;
|
|
3906
5689
|
}
|
|
3907
5690
|
|
|
3908
|
-
export { PlaycademyClient };
|
|
3909
|
-
export type {
|
|
5691
|
+
export { AchievementCompletionType, NotificationStatus, NotificationType, PlaycademyClient };
|
|
5692
|
+
export type { AchievementCurrent, AchievementHistoryEntry, AchievementProgressResponse, AchievementScopeType, AchievementWithStatus, AuthCallbackPayload, AuthOptions, AuthProviderType, AuthResult, AuthServerMessage, AuthStateChangePayload, AuthStateUpdate, AuthenticatedUser, BetterAuthApiKey, BetterAuthApiKeyResponse, BetterAuthSignInResponse, BucketFile, CharacterComponentRow as CharacterComponent, CharacterComponentType, CharacterComponentWithSpriteUrl, CharacterComponentsOptions, ClientConfig, ClientEvents, ConnectionStatePayload, CreateCharacterData, CreateMapObjectData, CurrencyRow as Currency, DevUploadEvent, DevUploadHooks, DeveloperStatusEnumType, DeveloperStatusResponse, DeveloperStatusValue, DisconnectContext, DisconnectHandler, DisplayAlertPayload, EventListeners, ExternalGame, FetchedGame, Game, GameContextPayload, GameCustomHostname, GameInitUser, GameLeaderboardEntry, MapRow as GameMap, GamePlatform, GameRow as GameRecord, GameSessionRow as GameSession, GameTimebackIntegration, GameTokenResponse, GameType, GameUser, HostedGame, InitPayload, InsertCurrencyInput, InsertItemInput, InsertShopListingInput, InteractionType, InventoryItemRow as InventoryItem, InventoryItemWithItem, InventoryMutationResponse, ItemRow as Item, ItemType, KeyEventPayload, LeaderboardEntry, LeaderboardOptions, LeaderboardTimeframe, LevelConfigRow as LevelConfig, LevelProgressResponse, LevelUpCheckResult, LoginResponse, ManifestV1, MapData, MapElementRow as MapElement, MapElementMetadata, MapElementWithGame, MapObjectRow as MapObject, MapObjectWithItem, NotificationRow as Notification, NotificationStats, PlaceableItemMetadata, PlatformTimebackUser, PlatformTimebackUserContext, PlaycademyServerClientConfig, PlaycademyServerClientState, PlayerCharacterRow as PlayerCharacter, PlayerCharacterAccessoryRow as PlayerCharacterAccessory, PlayerCurrency, PlayerInventoryItem, PlayerProfile, PlayerSessionPayload, PopulateStudentResponse, RealtimeTokenResponse, ScoreSubmission, ShopCurrency, ShopDisplayItem, ShopListingRow as ShopListing, ShopViewResponse, SpriteAnimationFrame, SpriteConfigWithDimensions, SpriteTemplateRow as SpriteTemplate, SpriteTemplateData, StartSessionResponse, TelemetryPayload, TimebackEnrollment, TimebackInitContext, TimebackOrganization, TimebackUser, TimebackUserContext, TodayXpResponse, TokenRefreshPayload, TokenType, TotalXpResponse, UpdateCharacterData, UpdateCurrencyInput, UpdateItemInput, UpdateShopListingInput, UpsertGameMetadataInput, UserRow as User, UserEnrollment, UserInfo, UserLevelRow as UserLevel, UserLevelWithConfig, UserOrganization, UserRank, UserRankResponse, UserRoleEnumType, UserScore, UserTimebackData, XPAddResult, XpHistoryResponse, XpSummaryResponse };
|