@playcademy/sdk 0.1.13 → 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 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
- assetBundleBase: drizzle_orm_pg_core.PgColumn<{
341
- name: "asset_bundle_base";
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: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
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: "body" | "outfit" | "hairstyle" | "eyes" | "accessory";
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
- bootMode: z.ZodEnum<["iframe", "module"]>;
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: "web" | "godot" | "unity";
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: "web" | "godot" | "unity";
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: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
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?: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other" | undefined;
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?: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other" | undefined;
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' | 'assetBundleBase' | 'externalUrl'>;
2916
+ type BaseGame = Omit<GameRow, 'gameType' | 'deploymentUrl' | 'externalUrl'>;
2733
2917
  type HostedGame = BaseGame & {
2734
2918
  gameType: 'hosted';
2735
- assetBundleBase: string;
2919
+ deploymentUrl: string;
2736
2920
  externalUrl: null;
2737
2921
  };
2738
2922
  type ExternalGame = BaseGame & {
2739
2923
  gameType: 'external';
2740
- assetBundleBase: null;
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
- type HostedGameWithManifest = HostedGame & {
2841
- manifest: ManifestV1;
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
@@ -3873,15 +4051,17 @@ declare class PlaycademyClient {
3873
4051
  get: () => Promise<DeveloperStatusValue>;
3874
4052
  };
3875
4053
  games: {
3876
- deploy: {
3877
- frontend: (slug: string, metadata: UpsertGameMetadataInput, file: File | Blob | null, hooks?: DevUploadHooks) => Promise<Game>;
3878
- backend: (slug: string, bundle: BackendDeploymentBundle) => Promise<BackendDeploymentResponse>;
3879
- seed: (slug: string, code: string, environment?: "staging" | "production") => Promise<{
3880
- success: boolean;
3881
- deploymentId: string;
3882
- executedAt: string;
3883
- }>;
3884
- };
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
+ }>;
3885
4065
  upsert: (slug: string, metadata: UpsertGameMetadataInput) => Promise<Game>;
3886
4066
  delete: (gameId: string) => Promise<void>;
3887
4067
  secrets: {
@@ -3907,6 +4087,12 @@ declare class PlaycademyClient {
3907
4087
  put: (slug: string, key: string, content: Blob | ArrayBuffer | Uint8Array, contentType?: string) => Promise<void>;
3908
4088
  delete: (slug: string, key: string) => Promise<void>;
3909
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
+ };
3910
4096
  };
3911
4097
  items: {
3912
4098
  create: (gameId: string, slug: string, itemData: Omit<InsertItemInput, "slug" | "gameId">) => Promise<Item>;
@@ -3943,10 +4129,10 @@ declare class PlaycademyClient {
3943
4129
  };
3944
4130
  items: {
3945
4131
  create: (props: InsertItemInput) => Promise<{
3946
- metadata: unknown;
3947
4132
  type: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
3948
- slug: string;
3949
4133
  id: string;
4134
+ metadata: unknown;
4135
+ slug: string;
3950
4136
  createdAt: Date;
3951
4137
  gameId: string | null;
3952
4138
  displayName: string;
@@ -3955,10 +4141,10 @@ declare class PlaycademyClient {
3955
4141
  imageUrl: string | null;
3956
4142
  }>;
3957
4143
  get: (itemId: string) => Promise<{
3958
- metadata: unknown;
3959
4144
  type: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
3960
- slug: string;
3961
4145
  id: string;
4146
+ metadata: unknown;
4147
+ slug: string;
3962
4148
  createdAt: Date;
3963
4149
  gameId: string | null;
3964
4150
  displayName: string;
@@ -3967,10 +4153,10 @@ declare class PlaycademyClient {
3967
4153
  imageUrl: string | null;
3968
4154
  }>;
3969
4155
  list: () => Promise<{
3970
- metadata: unknown;
3971
4156
  type: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
3972
- slug: string;
3973
4157
  id: string;
4158
+ metadata: unknown;
4159
+ slug: string;
3974
4160
  createdAt: Date;
3975
4161
  gameId: string | null;
3976
4162
  displayName: string;
@@ -3979,10 +4165,10 @@ declare class PlaycademyClient {
3979
4165
  imageUrl: string | null;
3980
4166
  }[]>;
3981
4167
  update: (itemId: string, props: UpdateItemInput) => Promise<{
3982
- metadata: unknown;
3983
4168
  type: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
3984
- slug: string;
3985
4169
  id: string;
4170
+ metadata: unknown;
4171
+ slug: string;
3986
4172
  createdAt: Date;
3987
4173
  gameId: string | null;
3988
4174
  displayName: string;
@@ -4236,6 +4422,30 @@ declare class PlaycademyClient {
4236
4422
  };
4237
4423
  }
4238
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
+
4239
4449
  /**
4240
4450
  * @fileoverview Playcademy Messaging System
4241
4451
  *
@@ -4780,5 +4990,5 @@ declare class PlaycademyMessaging {
4780
4990
  */
4781
4991
  declare const messaging: PlaycademyMessaging;
4782
4992
 
4783
- export { MessageEvents, PlaycademyClient, messaging };
4784
- export type { DevUploadEvent, DevUploadHooks };
4993
+ export { ApiError, MessageEvents, PlaycademyClient, PlaycademyError, extractApiErrorInfo, messaging };
4994
+ export type { ApiErrorInfo, DevUploadEvent, DevUploadHooks };