@playcademy/sdk 0.1.12 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +319 -101
- package/dist/index.js +144 -37
- package/dist/server.d.ts +3 -1
- package/dist/types.d.ts +299 -100
- package/package.json +4 -5
package/dist/index.d.ts
CHANGED
|
@@ -225,6 +225,23 @@ type GameMetadata = {
|
|
|
225
225
|
emoji?: string;
|
|
226
226
|
[key: string]: unknown;
|
|
227
227
|
};
|
|
228
|
+
/**
|
|
229
|
+
* DNS validation records for custom hostname
|
|
230
|
+
* Structure for the validationRecords JSON field in game_custom_hostnames table
|
|
231
|
+
*/
|
|
232
|
+
type CustomHostnameValidationRecords = {
|
|
233
|
+
/** TXT record for ownership verification */
|
|
234
|
+
ownership?: {
|
|
235
|
+
name?: string;
|
|
236
|
+
value?: string;
|
|
237
|
+
type?: string;
|
|
238
|
+
};
|
|
239
|
+
/** TXT records for SSL certificate validation */
|
|
240
|
+
ssl?: Array<{
|
|
241
|
+
txt_name?: string;
|
|
242
|
+
txt_value?: string;
|
|
243
|
+
}>;
|
|
244
|
+
};
|
|
228
245
|
declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
229
246
|
name: "games";
|
|
230
247
|
schema: undefined;
|
|
@@ -337,8 +354,8 @@ declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
337
354
|
identity: undefined;
|
|
338
355
|
generated: undefined;
|
|
339
356
|
}, {}, {}>;
|
|
340
|
-
|
|
341
|
-
name: "
|
|
357
|
+
deploymentUrl: drizzle_orm_pg_core.PgColumn<{
|
|
358
|
+
name: "deployment_url";
|
|
342
359
|
tableName: "games";
|
|
343
360
|
dataType: "string";
|
|
344
361
|
columnType: "PgText";
|
|
@@ -461,6 +478,207 @@ declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
461
478
|
};
|
|
462
479
|
dialect: "pg";
|
|
463
480
|
}>;
|
|
481
|
+
/**
|
|
482
|
+
* Custom hostnames table
|
|
483
|
+
*
|
|
484
|
+
* Stores custom domain mappings for games with SSL provisioning via Cloudflare.
|
|
485
|
+
*/
|
|
486
|
+
declare const gameCustomHostnames: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
487
|
+
name: "game_custom_hostnames";
|
|
488
|
+
schema: undefined;
|
|
489
|
+
columns: {
|
|
490
|
+
id: drizzle_orm_pg_core.PgColumn<{
|
|
491
|
+
name: "id";
|
|
492
|
+
tableName: "game_custom_hostnames";
|
|
493
|
+
dataType: "string";
|
|
494
|
+
columnType: "PgUUID";
|
|
495
|
+
data: string;
|
|
496
|
+
driverParam: string;
|
|
497
|
+
notNull: true;
|
|
498
|
+
hasDefault: true;
|
|
499
|
+
isPrimaryKey: true;
|
|
500
|
+
isAutoincrement: false;
|
|
501
|
+
hasRuntimeDefault: false;
|
|
502
|
+
enumValues: undefined;
|
|
503
|
+
baseColumn: never;
|
|
504
|
+
identity: undefined;
|
|
505
|
+
generated: undefined;
|
|
506
|
+
}, {}, {}>;
|
|
507
|
+
gameId: drizzle_orm_pg_core.PgColumn<{
|
|
508
|
+
name: "game_id";
|
|
509
|
+
tableName: "game_custom_hostnames";
|
|
510
|
+
dataType: "string";
|
|
511
|
+
columnType: "PgUUID";
|
|
512
|
+
data: string;
|
|
513
|
+
driverParam: string;
|
|
514
|
+
notNull: true;
|
|
515
|
+
hasDefault: false;
|
|
516
|
+
isPrimaryKey: false;
|
|
517
|
+
isAutoincrement: false;
|
|
518
|
+
hasRuntimeDefault: false;
|
|
519
|
+
enumValues: undefined;
|
|
520
|
+
baseColumn: never;
|
|
521
|
+
identity: undefined;
|
|
522
|
+
generated: undefined;
|
|
523
|
+
}, {}, {}>;
|
|
524
|
+
userId: drizzle_orm_pg_core.PgColumn<{
|
|
525
|
+
name: "user_id";
|
|
526
|
+
tableName: "game_custom_hostnames";
|
|
527
|
+
dataType: "string";
|
|
528
|
+
columnType: "PgText";
|
|
529
|
+
data: string;
|
|
530
|
+
driverParam: string;
|
|
531
|
+
notNull: true;
|
|
532
|
+
hasDefault: false;
|
|
533
|
+
isPrimaryKey: false;
|
|
534
|
+
isAutoincrement: false;
|
|
535
|
+
hasRuntimeDefault: false;
|
|
536
|
+
enumValues: [string, ...string[]];
|
|
537
|
+
baseColumn: never;
|
|
538
|
+
identity: undefined;
|
|
539
|
+
generated: undefined;
|
|
540
|
+
}, {}, {}>;
|
|
541
|
+
hostname: drizzle_orm_pg_core.PgColumn<{
|
|
542
|
+
name: "hostname";
|
|
543
|
+
tableName: "game_custom_hostnames";
|
|
544
|
+
dataType: "string";
|
|
545
|
+
columnType: "PgText";
|
|
546
|
+
data: string;
|
|
547
|
+
driverParam: string;
|
|
548
|
+
notNull: true;
|
|
549
|
+
hasDefault: false;
|
|
550
|
+
isPrimaryKey: false;
|
|
551
|
+
isAutoincrement: false;
|
|
552
|
+
hasRuntimeDefault: false;
|
|
553
|
+
enumValues: [string, ...string[]];
|
|
554
|
+
baseColumn: never;
|
|
555
|
+
identity: undefined;
|
|
556
|
+
generated: undefined;
|
|
557
|
+
}, {}, {}>;
|
|
558
|
+
cloudflareId: drizzle_orm_pg_core.PgColumn<{
|
|
559
|
+
name: "cloudflare_id";
|
|
560
|
+
tableName: "game_custom_hostnames";
|
|
561
|
+
dataType: "string";
|
|
562
|
+
columnType: "PgText";
|
|
563
|
+
data: string;
|
|
564
|
+
driverParam: string;
|
|
565
|
+
notNull: true;
|
|
566
|
+
hasDefault: false;
|
|
567
|
+
isPrimaryKey: false;
|
|
568
|
+
isAutoincrement: false;
|
|
569
|
+
hasRuntimeDefault: false;
|
|
570
|
+
enumValues: [string, ...string[]];
|
|
571
|
+
baseColumn: never;
|
|
572
|
+
identity: undefined;
|
|
573
|
+
generated: undefined;
|
|
574
|
+
}, {}, {}>;
|
|
575
|
+
environment: drizzle_orm_pg_core.PgColumn<{
|
|
576
|
+
name: "environment";
|
|
577
|
+
tableName: "game_custom_hostnames";
|
|
578
|
+
dataType: "string";
|
|
579
|
+
columnType: "PgEnumColumn";
|
|
580
|
+
data: "staging" | "production";
|
|
581
|
+
driverParam: string;
|
|
582
|
+
notNull: true;
|
|
583
|
+
hasDefault: true;
|
|
584
|
+
isPrimaryKey: false;
|
|
585
|
+
isAutoincrement: false;
|
|
586
|
+
hasRuntimeDefault: false;
|
|
587
|
+
enumValues: ["staging", "production"];
|
|
588
|
+
baseColumn: never;
|
|
589
|
+
identity: undefined;
|
|
590
|
+
generated: undefined;
|
|
591
|
+
}, {}, {}>;
|
|
592
|
+
status: drizzle_orm_pg_core.PgColumn<{
|
|
593
|
+
name: "status";
|
|
594
|
+
tableName: "game_custom_hostnames";
|
|
595
|
+
dataType: "string";
|
|
596
|
+
columnType: "PgEnumColumn";
|
|
597
|
+
data: "pending" | "pending_validation" | "pending_deployment" | "pending_deletion" | "active" | "blocked" | "deleted";
|
|
598
|
+
driverParam: string;
|
|
599
|
+
notNull: true;
|
|
600
|
+
hasDefault: true;
|
|
601
|
+
isPrimaryKey: false;
|
|
602
|
+
isAutoincrement: false;
|
|
603
|
+
hasRuntimeDefault: false;
|
|
604
|
+
enumValues: ["pending", "pending_validation", "pending_deployment", "pending_deletion", "active", "blocked", "deleted"];
|
|
605
|
+
baseColumn: never;
|
|
606
|
+
identity: undefined;
|
|
607
|
+
generated: undefined;
|
|
608
|
+
}, {}, {}>;
|
|
609
|
+
sslStatus: drizzle_orm_pg_core.PgColumn<{
|
|
610
|
+
name: "ssl_status";
|
|
611
|
+
tableName: "game_custom_hostnames";
|
|
612
|
+
dataType: "string";
|
|
613
|
+
columnType: "PgEnumColumn";
|
|
614
|
+
data: "pending_validation" | "pending_deployment" | "active" | "deleted" | "initializing" | "pending_issuance";
|
|
615
|
+
driverParam: string;
|
|
616
|
+
notNull: true;
|
|
617
|
+
hasDefault: true;
|
|
618
|
+
isPrimaryKey: false;
|
|
619
|
+
isAutoincrement: false;
|
|
620
|
+
hasRuntimeDefault: false;
|
|
621
|
+
enumValues: ["initializing", "pending_validation", "pending_issuance", "pending_deployment", "active", "deleted"];
|
|
622
|
+
baseColumn: never;
|
|
623
|
+
identity: undefined;
|
|
624
|
+
generated: undefined;
|
|
625
|
+
}, {}, {}>;
|
|
626
|
+
validationRecords: drizzle_orm_pg_core.PgColumn<{
|
|
627
|
+
name: "validation_records";
|
|
628
|
+
tableName: "game_custom_hostnames";
|
|
629
|
+
dataType: "json";
|
|
630
|
+
columnType: "PgJsonb";
|
|
631
|
+
data: CustomHostnameValidationRecords;
|
|
632
|
+
driverParam: unknown;
|
|
633
|
+
notNull: false;
|
|
634
|
+
hasDefault: false;
|
|
635
|
+
isPrimaryKey: false;
|
|
636
|
+
isAutoincrement: false;
|
|
637
|
+
hasRuntimeDefault: false;
|
|
638
|
+
enumValues: undefined;
|
|
639
|
+
baseColumn: never;
|
|
640
|
+
identity: undefined;
|
|
641
|
+
generated: undefined;
|
|
642
|
+
}, {}, {
|
|
643
|
+
$type: CustomHostnameValidationRecords;
|
|
644
|
+
}>;
|
|
645
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
646
|
+
name: "created_at";
|
|
647
|
+
tableName: "game_custom_hostnames";
|
|
648
|
+
dataType: "date";
|
|
649
|
+
columnType: "PgTimestamp";
|
|
650
|
+
data: Date;
|
|
651
|
+
driverParam: string;
|
|
652
|
+
notNull: true;
|
|
653
|
+
hasDefault: true;
|
|
654
|
+
isPrimaryKey: false;
|
|
655
|
+
isAutoincrement: false;
|
|
656
|
+
hasRuntimeDefault: false;
|
|
657
|
+
enumValues: undefined;
|
|
658
|
+
baseColumn: never;
|
|
659
|
+
identity: undefined;
|
|
660
|
+
generated: undefined;
|
|
661
|
+
}, {}, {}>;
|
|
662
|
+
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
663
|
+
name: "updated_at";
|
|
664
|
+
tableName: "game_custom_hostnames";
|
|
665
|
+
dataType: "date";
|
|
666
|
+
columnType: "PgTimestamp";
|
|
667
|
+
data: Date;
|
|
668
|
+
driverParam: string;
|
|
669
|
+
notNull: true;
|
|
670
|
+
hasDefault: true;
|
|
671
|
+
isPrimaryKey: false;
|
|
672
|
+
isAutoincrement: false;
|
|
673
|
+
hasRuntimeDefault: false;
|
|
674
|
+
enumValues: undefined;
|
|
675
|
+
baseColumn: never;
|
|
676
|
+
identity: undefined;
|
|
677
|
+
generated: undefined;
|
|
678
|
+
}, {}, {}>;
|
|
679
|
+
};
|
|
680
|
+
dialect: "pg";
|
|
681
|
+
}>;
|
|
464
682
|
declare const items: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
465
683
|
name: "items";
|
|
466
684
|
schema: undefined;
|
|
@@ -555,7 +773,7 @@ declare const items: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
555
773
|
tableName: "items";
|
|
556
774
|
dataType: "string";
|
|
557
775
|
columnType: "PgEnumColumn";
|
|
558
|
-
data: "
|
|
776
|
+
data: "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "accessory" | "other";
|
|
559
777
|
driverParam: string;
|
|
560
778
|
notNull: true;
|
|
561
779
|
hasDefault: true;
|
|
@@ -1442,7 +1660,7 @@ declare const characterComponents: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
1442
1660
|
tableName: "character_components";
|
|
1443
1661
|
dataType: "string";
|
|
1444
1662
|
columnType: "PgEnumColumn";
|
|
1445
|
-
data: "
|
|
1663
|
+
data: "accessory" | "body" | "outfit" | "hairstyle" | "eyes";
|
|
1446
1664
|
driverParam: string;
|
|
1447
1665
|
notNull: true;
|
|
1448
1666
|
hasDefault: false;
|
|
@@ -2292,66 +2510,32 @@ declare const UpsertGameMetadataSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2292
2510
|
mapElementId?: string | null | undefined;
|
|
2293
2511
|
metadata?: Record<string, unknown> | undefined;
|
|
2294
2512
|
}>;
|
|
2513
|
+
/**
|
|
2514
|
+
* Simplified game manifest for Cloudflare Workers deployments
|
|
2515
|
+
*
|
|
2516
|
+
* The manifest is auto-generated by build tools (Godot plugin, Vite plugin, etc.)
|
|
2517
|
+
* and provides minimal metadata about the build.
|
|
2518
|
+
*
|
|
2519
|
+
* Fields:
|
|
2520
|
+
* - version: Manifest schema version (for future migrations)
|
|
2521
|
+
* - platform: Auto-detected by build tool (e.g., 'web', 'godot@4.3', 'unity@2023')
|
|
2522
|
+
* - createdAt: Build timestamp (ISO 8601)
|
|
2523
|
+
*
|
|
2524
|
+
* Note: With unified Cloudflare Workers deployments, the worker handles all routing
|
|
2525
|
+
* internally, so we no longer need bootMode, entryPoint, or styles fields.
|
|
2526
|
+
*/
|
|
2295
2527
|
declare const ManifestV1Schema: z.ZodObject<{
|
|
2296
2528
|
version: z.ZodString;
|
|
2297
|
-
|
|
2298
|
-
entryPoint: z.ZodEffects<z.ZodString, string, string>;
|
|
2299
|
-
/**
|
|
2300
|
-
* An array of relative paths to CSS stylesheets.
|
|
2301
|
-
* Currently, this property is ONLY utilized by the 'module' boot mode
|
|
2302
|
-
* (`apps/cademy/src/lib/loader/boot-module.ts`) to load external
|
|
2303
|
-
* stylesheets into the game's shadow DOM.
|
|
2304
|
-
*
|
|
2305
|
-
* This property is under review for potential deprecation and removal.
|
|
2306
|
-
* The 'module' boot mode itself has not yet seen significant adoption
|
|
2307
|
-
* or clear use-cases, and if support for module loading is removed in
|
|
2308
|
-
* the future, this 'styles' property would become obsolete.
|
|
2309
|
-
*
|
|
2310
|
-
* If module-based games need styling, alternative approaches might involve
|
|
2311
|
-
* bundling CSS within their JavaScript or managing style injection internally.
|
|
2312
|
-
*/
|
|
2313
|
-
styles: z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodString, "many">>, string[] | undefined, string[] | undefined>;
|
|
2314
|
-
/**
|
|
2315
|
-
* Specifies the game or development platform.
|
|
2316
|
-
* Current values include 'web', 'godot', and 'unity'.
|
|
2317
|
-
* The default in the database is 'web'.
|
|
2318
|
-
*
|
|
2319
|
-
* IMPORTANT: This property is NOT CURRENTLY USED by the core loader
|
|
2320
|
-
* or runtime systems in any functional way. It is present in the manifest
|
|
2321
|
-
* but does not drive any specific behavior in `boot-iframe.ts` or
|
|
2322
|
-
* `boot-module.ts` beyond being a piece of metadata.
|
|
2323
|
-
*
|
|
2324
|
-
* Potential Future Uses (Speculative):
|
|
2325
|
-
* - Analytics: Could be used to gather stats on platform popularity/usage.
|
|
2326
|
-
* - Developer Portal: Might inform UI/UX in the dev portal, e.g., showing
|
|
2327
|
-
* platform-specific guides or settings.
|
|
2328
|
-
* - Loader Optimizations: In the future, the loader could potentially use this
|
|
2329
|
-
* to apply platform-specific loading strategies or workarounds, though this
|
|
2330
|
-
* is unlikely given the current generic boot process.
|
|
2331
|
-
* - Asset Pipeline: Could hint to future asset pipeline tools about expected
|
|
2332
|
-
* project structures or build artifacts for different platforms.
|
|
2333
|
-
*
|
|
2334
|
-
* The field is intentionally kept somewhat generic. If finer-grained
|
|
2335
|
-
* distinctions are ever needed (e.g., specific web frameworks like 'phaser',
|
|
2336
|
-
* 'three'), this schema might need to be revisited or a separate
|
|
2337
|
-
* 'platformVersion' or 'framework' field could be added.
|
|
2338
|
-
*/
|
|
2339
|
-
platform: z.ZodEnum<["web", "godot", "unity"]>;
|
|
2529
|
+
platform: z.ZodString;
|
|
2340
2530
|
createdAt: z.ZodString;
|
|
2341
2531
|
}, "strip", z.ZodTypeAny, {
|
|
2342
2532
|
createdAt: string;
|
|
2343
2533
|
version: string;
|
|
2344
|
-
platform:
|
|
2345
|
-
bootMode: "iframe" | "module";
|
|
2346
|
-
entryPoint: string;
|
|
2347
|
-
styles?: string[] | undefined;
|
|
2534
|
+
platform: string;
|
|
2348
2535
|
}, {
|
|
2349
2536
|
createdAt: string;
|
|
2350
2537
|
version: string;
|
|
2351
|
-
platform:
|
|
2352
|
-
bootMode: "iframe" | "module";
|
|
2353
|
-
entryPoint: string;
|
|
2354
|
-
styles?: string[] | undefined;
|
|
2538
|
+
platform: string;
|
|
2355
2539
|
}>;
|
|
2356
2540
|
declare const InsertItemSchema: drizzle_zod.BuildSchema<"insert", {
|
|
2357
2541
|
id: drizzle_orm_pg_core.PgColumn<{
|
|
@@ -2444,7 +2628,7 @@ declare const InsertItemSchema: drizzle_zod.BuildSchema<"insert", {
|
|
|
2444
2628
|
tableName: "items";
|
|
2445
2629
|
dataType: "string";
|
|
2446
2630
|
columnType: "PgEnumColumn";
|
|
2447
|
-
data: "
|
|
2631
|
+
data: "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "accessory" | "other";
|
|
2448
2632
|
driverParam: string;
|
|
2449
2633
|
notNull: true;
|
|
2450
2634
|
hasDefault: true;
|
|
@@ -2540,21 +2724,21 @@ declare const UpdateItemSchema: z.ZodObject<Omit<{
|
|
|
2540
2724
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2541
2725
|
createdAt: z.ZodOptional<z.ZodDate>;
|
|
2542
2726
|
}, "id" | "createdAt">, "strip", z.ZodTypeAny, {
|
|
2727
|
+
slug?: string | undefined;
|
|
2543
2728
|
description?: string | null | undefined;
|
|
2544
2729
|
displayName?: string | undefined;
|
|
2545
|
-
slug?: string | undefined;
|
|
2546
2730
|
metadata?: Record<string, unknown> | undefined;
|
|
2547
2731
|
gameId?: string | null | undefined;
|
|
2548
|
-
type?: "
|
|
2732
|
+
type?: "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "accessory" | "other" | undefined;
|
|
2549
2733
|
isPlaceable?: boolean | undefined;
|
|
2550
2734
|
imageUrl?: string | null | undefined;
|
|
2551
2735
|
}, {
|
|
2736
|
+
slug?: string | undefined;
|
|
2552
2737
|
description?: string | null | undefined;
|
|
2553
2738
|
displayName?: string | undefined;
|
|
2554
|
-
slug?: string | undefined;
|
|
2555
2739
|
metadata?: Record<string, unknown> | undefined;
|
|
2556
2740
|
gameId?: string | null | undefined;
|
|
2557
|
-
type?: "
|
|
2741
|
+
type?: "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "accessory" | "other" | undefined;
|
|
2558
2742
|
isPlaceable?: boolean | undefined;
|
|
2559
2743
|
imageUrl?: string | null | undefined;
|
|
2560
2744
|
}>;
|
|
@@ -2600,10 +2784,10 @@ declare const InsertShopListingSchema: z.ZodObject<Omit<{
|
|
|
2600
2784
|
createdAt: z.ZodOptional<z.ZodDate>;
|
|
2601
2785
|
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
2602
2786
|
}, "id" | "createdAt" | "updatedAt">, "strip", z.ZodTypeAny, {
|
|
2787
|
+
isActive: boolean;
|
|
2603
2788
|
itemId: string;
|
|
2604
2789
|
currencyId: string;
|
|
2605
2790
|
price: number;
|
|
2606
|
-
isActive: boolean;
|
|
2607
2791
|
sellBackPercentage?: number | null | undefined;
|
|
2608
2792
|
stock?: number | null | undefined;
|
|
2609
2793
|
availableFrom?: Date | null | undefined;
|
|
@@ -2612,37 +2796,37 @@ declare const InsertShopListingSchema: z.ZodObject<Omit<{
|
|
|
2612
2796
|
itemId: string;
|
|
2613
2797
|
currencyId: string;
|
|
2614
2798
|
price: number;
|
|
2799
|
+
isActive?: boolean | undefined;
|
|
2615
2800
|
sellBackPercentage?: number | null | undefined;
|
|
2616
2801
|
stock?: number | null | undefined;
|
|
2617
|
-
isActive?: boolean | undefined;
|
|
2618
2802
|
availableFrom?: Date | null | undefined;
|
|
2619
2803
|
availableUntil?: Date | null | undefined;
|
|
2620
2804
|
}>;
|
|
2621
2805
|
declare const UpdateShopListingSchema: z.ZodObject<{
|
|
2806
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
2622
2807
|
itemId: z.ZodOptional<z.ZodString>;
|
|
2623
2808
|
currencyId: z.ZodOptional<z.ZodString>;
|
|
2624
2809
|
price: z.ZodOptional<z.ZodNumber>;
|
|
2625
2810
|
sellBackPercentage: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNumber>>>;
|
|
2626
2811
|
stock: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNumber>>>;
|
|
2627
|
-
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
2628
2812
|
availableFrom: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodDate>>>;
|
|
2629
2813
|
availableUntil: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodDate>>>;
|
|
2630
2814
|
}, "strip", z.ZodTypeAny, {
|
|
2815
|
+
isActive?: boolean | undefined;
|
|
2631
2816
|
itemId?: string | undefined;
|
|
2632
2817
|
currencyId?: string | undefined;
|
|
2633
2818
|
price?: number | undefined;
|
|
2634
2819
|
sellBackPercentage?: number | null | undefined;
|
|
2635
2820
|
stock?: number | null | undefined;
|
|
2636
|
-
isActive?: boolean | undefined;
|
|
2637
2821
|
availableFrom?: Date | null | undefined;
|
|
2638
2822
|
availableUntil?: Date | null | undefined;
|
|
2639
2823
|
}, {
|
|
2824
|
+
isActive?: boolean | undefined;
|
|
2640
2825
|
itemId?: string | undefined;
|
|
2641
2826
|
currencyId?: string | undefined;
|
|
2642
2827
|
price?: number | undefined;
|
|
2643
2828
|
sellBackPercentage?: number | null | undefined;
|
|
2644
2829
|
stock?: number | null | undefined;
|
|
2645
|
-
isActive?: boolean | undefined;
|
|
2646
2830
|
availableFrom?: Date | null | undefined;
|
|
2647
2831
|
availableUntil?: Date | null | undefined;
|
|
2648
2832
|
}>;
|
|
@@ -2729,31 +2913,21 @@ type PlayerCharacter = typeof playerCharacters.$inferSelect & {
|
|
|
2729
2913
|
};
|
|
2730
2914
|
type PlayerCharacterAccessory = typeof playerCharacterAccessories.$inferSelect;
|
|
2731
2915
|
type GameRow = typeof games.$inferSelect;
|
|
2732
|
-
type BaseGame = Omit<GameRow, 'gameType' | '
|
|
2916
|
+
type BaseGame = Omit<GameRow, 'gameType' | 'deploymentUrl' | 'externalUrl'>;
|
|
2733
2917
|
type HostedGame = BaseGame & {
|
|
2734
2918
|
gameType: 'hosted';
|
|
2735
|
-
|
|
2919
|
+
deploymentUrl: string;
|
|
2736
2920
|
externalUrl: null;
|
|
2737
2921
|
};
|
|
2738
2922
|
type ExternalGame = BaseGame & {
|
|
2739
2923
|
gameType: 'external';
|
|
2740
|
-
|
|
2924
|
+
deploymentUrl: null;
|
|
2741
2925
|
externalUrl: string;
|
|
2742
2926
|
};
|
|
2743
2927
|
type Game = HostedGame | ExternalGame;
|
|
2744
2928
|
type GameStateData = Record<string, unknown>;
|
|
2929
|
+
type GameCustomHostname = typeof gameCustomHostnames.$inferSelect;
|
|
2745
2930
|
type UpsertGameMetadataInput = z.infer<typeof UpsertGameMetadataSchema>;
|
|
2746
|
-
/**
|
|
2747
|
-
* Response from backend deployment API
|
|
2748
|
-
*/
|
|
2749
|
-
interface BackendDeploymentResponse {
|
|
2750
|
-
/** Unique deployment ID */
|
|
2751
|
-
deploymentId: string;
|
|
2752
|
-
/** Backend API URL */
|
|
2753
|
-
url: string;
|
|
2754
|
-
/** Deployment timestamp */
|
|
2755
|
-
deployedAt: string;
|
|
2756
|
-
}
|
|
2757
2931
|
type Item = typeof items.$inferSelect;
|
|
2758
2932
|
type InventoryItem = typeof inventoryItems.$inferSelect;
|
|
2759
2933
|
type ShopListing = typeof shopListings.$inferSelect;
|
|
@@ -2837,10 +3011,12 @@ type CharacterComponentWithSpriteUrl = CharacterComponent & {
|
|
|
2837
3011
|
type InventoryItemWithItem = Omit<InventoryItem, 'itemId'> & {
|
|
2838
3012
|
item: Item;
|
|
2839
3013
|
};
|
|
2840
|
-
|
|
2841
|
-
|
|
3014
|
+
/**
|
|
3015
|
+
* Game with optional manifest metadata from build tools
|
|
3016
|
+
*/
|
|
3017
|
+
type FetchedGame = (HostedGame | ExternalGame | GameRow) & {
|
|
3018
|
+
manifest?: ManifestV1;
|
|
2842
3019
|
};
|
|
2843
|
-
type FetchedGame = HostedGameWithManifest | GameRow;
|
|
2844
3020
|
/**
|
|
2845
3021
|
* Map-related Composite Types
|
|
2846
3022
|
* Types that combine map, game, and item data for rendering and interaction
|
|
@@ -3164,6 +3340,8 @@ interface IntegrationsConfig {
|
|
|
3164
3340
|
kv?: boolean;
|
|
3165
3341
|
/** Bucket storage (optional) */
|
|
3166
3342
|
bucket?: boolean;
|
|
3343
|
+
/** Authentication (optional) */
|
|
3344
|
+
auth?: boolean;
|
|
3167
3345
|
}
|
|
3168
3346
|
/**
|
|
3169
3347
|
* Unified Playcademy configuration
|
|
@@ -3817,6 +3995,14 @@ declare class PlaycademyClient {
|
|
|
3817
3995
|
}) => void) | (() => void) | ((isVisible: boolean) => void)) => void;
|
|
3818
3996
|
removeAllListeners: () => void;
|
|
3819
3997
|
getListenerCounts: () => Record<string, number>;
|
|
3998
|
+
cdn: {
|
|
3999
|
+
url(pathOrStrings: string | TemplateStringsArray, ...values: unknown[]): string;
|
|
4000
|
+
fetch: (path: string, options?: RequestInit) => Promise<Response>;
|
|
4001
|
+
json: <T = unknown>(path: string) => Promise<T>;
|
|
4002
|
+
blob: (path: string) => Promise<Blob>;
|
|
4003
|
+
text: (path: string) => Promise<string>;
|
|
4004
|
+
arrayBuffer: (path: string) => Promise<ArrayBuffer>;
|
|
4005
|
+
};
|
|
3820
4006
|
};
|
|
3821
4007
|
/** Game management methods (fetch, list, saveState, loadState, sessions) */
|
|
3822
4008
|
games: {
|
|
@@ -3865,15 +4051,17 @@ declare class PlaycademyClient {
|
|
|
3865
4051
|
get: () => Promise<DeveloperStatusValue>;
|
|
3866
4052
|
};
|
|
3867
4053
|
games: {
|
|
3868
|
-
deploy: {
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
4054
|
+
deploy: (slug: string, options: {
|
|
4055
|
+
metadata?: UpsertGameMetadataInput;
|
|
4056
|
+
file?: File | Blob | null;
|
|
4057
|
+
backend?: BackendDeploymentBundle;
|
|
4058
|
+
hooks?: DevUploadHooks;
|
|
4059
|
+
}) => Promise<Game>;
|
|
4060
|
+
seed: (slug: string, code: string, environment?: "staging" | "production") => Promise<{
|
|
4061
|
+
success: boolean;
|
|
4062
|
+
deploymentId: string;
|
|
4063
|
+
executedAt: string;
|
|
4064
|
+
}>;
|
|
3877
4065
|
upsert: (slug: string, metadata: UpsertGameMetadataInput) => Promise<Game>;
|
|
3878
4066
|
delete: (gameId: string) => Promise<void>;
|
|
3879
4067
|
secrets: {
|
|
@@ -3899,6 +4087,12 @@ declare class PlaycademyClient {
|
|
|
3899
4087
|
put: (slug: string, key: string, content: Blob | ArrayBuffer | Uint8Array, contentType?: string) => Promise<void>;
|
|
3900
4088
|
delete: (slug: string, key: string) => Promise<void>;
|
|
3901
4089
|
};
|
|
4090
|
+
domains: {
|
|
4091
|
+
add: (slug: string, hostname: string) => Promise<GameCustomHostname>;
|
|
4092
|
+
list: (slug: string) => Promise<GameCustomHostname[]>;
|
|
4093
|
+
status: (slug: string, hostname: string, refresh?: boolean) => Promise<GameCustomHostname>;
|
|
4094
|
+
delete: (slug: string, hostname: string) => Promise<void>;
|
|
4095
|
+
};
|
|
3902
4096
|
};
|
|
3903
4097
|
items: {
|
|
3904
4098
|
create: (gameId: string, slug: string, itemData: Omit<InsertItemInput, "slug" | "gameId">) => Promise<Item>;
|
|
@@ -3935,10 +4129,10 @@ declare class PlaycademyClient {
|
|
|
3935
4129
|
};
|
|
3936
4130
|
items: {
|
|
3937
4131
|
create: (props: InsertItemInput) => Promise<{
|
|
3938
|
-
metadata: unknown;
|
|
3939
4132
|
type: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
|
|
3940
|
-
slug: string;
|
|
3941
4133
|
id: string;
|
|
4134
|
+
metadata: unknown;
|
|
4135
|
+
slug: string;
|
|
3942
4136
|
createdAt: Date;
|
|
3943
4137
|
gameId: string | null;
|
|
3944
4138
|
displayName: string;
|
|
@@ -3947,10 +4141,10 @@ declare class PlaycademyClient {
|
|
|
3947
4141
|
imageUrl: string | null;
|
|
3948
4142
|
}>;
|
|
3949
4143
|
get: (itemId: string) => Promise<{
|
|
3950
|
-
metadata: unknown;
|
|
3951
4144
|
type: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
|
|
3952
|
-
slug: string;
|
|
3953
4145
|
id: string;
|
|
4146
|
+
metadata: unknown;
|
|
4147
|
+
slug: string;
|
|
3954
4148
|
createdAt: Date;
|
|
3955
4149
|
gameId: string | null;
|
|
3956
4150
|
displayName: string;
|
|
@@ -3959,10 +4153,10 @@ declare class PlaycademyClient {
|
|
|
3959
4153
|
imageUrl: string | null;
|
|
3960
4154
|
}>;
|
|
3961
4155
|
list: () => Promise<{
|
|
3962
|
-
metadata: unknown;
|
|
3963
4156
|
type: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
|
|
3964
|
-
slug: string;
|
|
3965
4157
|
id: string;
|
|
4158
|
+
metadata: unknown;
|
|
4159
|
+
slug: string;
|
|
3966
4160
|
createdAt: Date;
|
|
3967
4161
|
gameId: string | null;
|
|
3968
4162
|
displayName: string;
|
|
@@ -3971,10 +4165,10 @@ declare class PlaycademyClient {
|
|
|
3971
4165
|
imageUrl: string | null;
|
|
3972
4166
|
}[]>;
|
|
3973
4167
|
update: (itemId: string, props: UpdateItemInput) => Promise<{
|
|
3974
|
-
metadata: unknown;
|
|
3975
4168
|
type: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
|
|
3976
|
-
slug: string;
|
|
3977
4169
|
id: string;
|
|
4170
|
+
metadata: unknown;
|
|
4171
|
+
slug: string;
|
|
3978
4172
|
createdAt: Date;
|
|
3979
4173
|
gameId: string | null;
|
|
3980
4174
|
displayName: string;
|
|
@@ -4228,6 +4422,30 @@ declare class PlaycademyClient {
|
|
|
4228
4422
|
};
|
|
4229
4423
|
}
|
|
4230
4424
|
|
|
4425
|
+
/**
|
|
4426
|
+
* Base error class for Cademy SDK specific errors.
|
|
4427
|
+
*/
|
|
4428
|
+
declare class PlaycademyError extends Error {
|
|
4429
|
+
constructor(message: string);
|
|
4430
|
+
}
|
|
4431
|
+
declare class ApiError extends Error {
|
|
4432
|
+
status: number;
|
|
4433
|
+
details: unknown;
|
|
4434
|
+
constructor(status: number, message: string, details: unknown);
|
|
4435
|
+
}
|
|
4436
|
+
/**
|
|
4437
|
+
* Extract useful error information from an API error
|
|
4438
|
+
* Useful for displaying errors to users in a friendly way
|
|
4439
|
+
*/
|
|
4440
|
+
interface ApiErrorInfo {
|
|
4441
|
+
status: number;
|
|
4442
|
+
statusText: string;
|
|
4443
|
+
error?: string;
|
|
4444
|
+
message?: string;
|
|
4445
|
+
details?: unknown;
|
|
4446
|
+
}
|
|
4447
|
+
declare function extractApiErrorInfo(error: unknown): ApiErrorInfo | null;
|
|
4448
|
+
|
|
4231
4449
|
/**
|
|
4232
4450
|
* @fileoverview Playcademy Messaging System
|
|
4233
4451
|
*
|
|
@@ -4772,5 +4990,5 @@ declare class PlaycademyMessaging {
|
|
|
4772
4990
|
*/
|
|
4773
4991
|
declare const messaging: PlaycademyMessaging;
|
|
4774
4992
|
|
|
4775
|
-
export { MessageEvents, PlaycademyClient, messaging };
|
|
4776
|
-
export type { DevUploadEvent, DevUploadHooks };
|
|
4993
|
+
export { ApiError, MessageEvents, PlaycademyClient, PlaycademyError, extractApiErrorInfo, messaging };
|
|
4994
|
+
export type { ApiErrorInfo, DevUploadEvent, DevUploadHooks };
|