@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 +311 -101
- package/dist/index.js +106 -43
- package/dist/server.d.ts +3 -1
- package/dist/types.d.ts +291 -101
- package/package.json +3 -4
package/dist/types.d.ts
CHANGED
|
@@ -226,6 +226,23 @@ type GameMetadata = {
|
|
|
226
226
|
emoji?: string;
|
|
227
227
|
[key: string]: unknown;
|
|
228
228
|
};
|
|
229
|
+
/**
|
|
230
|
+
* DNS validation records for custom hostname
|
|
231
|
+
* Structure for the validationRecords JSON field in game_custom_hostnames table
|
|
232
|
+
*/
|
|
233
|
+
type CustomHostnameValidationRecords = {
|
|
234
|
+
/** TXT record for ownership verification */
|
|
235
|
+
ownership?: {
|
|
236
|
+
name?: string;
|
|
237
|
+
value?: string;
|
|
238
|
+
type?: string;
|
|
239
|
+
};
|
|
240
|
+
/** TXT records for SSL certificate validation */
|
|
241
|
+
ssl?: Array<{
|
|
242
|
+
txt_name?: string;
|
|
243
|
+
txt_value?: string;
|
|
244
|
+
}>;
|
|
245
|
+
};
|
|
229
246
|
declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
230
247
|
name: "games";
|
|
231
248
|
schema: undefined;
|
|
@@ -338,8 +355,8 @@ declare const games: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
338
355
|
identity: undefined;
|
|
339
356
|
generated: undefined;
|
|
340
357
|
}, {}, {}>;
|
|
341
|
-
|
|
342
|
-
name: "
|
|
358
|
+
deploymentUrl: drizzle_orm_pg_core.PgColumn<{
|
|
359
|
+
name: "deployment_url";
|
|
343
360
|
tableName: "games";
|
|
344
361
|
dataType: "string";
|
|
345
362
|
columnType: "PgText";
|
|
@@ -554,6 +571,207 @@ declare const gameSessions: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
554
571
|
};
|
|
555
572
|
dialect: "pg";
|
|
556
573
|
}>;
|
|
574
|
+
/**
|
|
575
|
+
* Custom hostnames table
|
|
576
|
+
*
|
|
577
|
+
* Stores custom domain mappings for games with SSL provisioning via Cloudflare.
|
|
578
|
+
*/
|
|
579
|
+
declare const gameCustomHostnames: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
580
|
+
name: "game_custom_hostnames";
|
|
581
|
+
schema: undefined;
|
|
582
|
+
columns: {
|
|
583
|
+
id: drizzle_orm_pg_core.PgColumn<{
|
|
584
|
+
name: "id";
|
|
585
|
+
tableName: "game_custom_hostnames";
|
|
586
|
+
dataType: "string";
|
|
587
|
+
columnType: "PgUUID";
|
|
588
|
+
data: string;
|
|
589
|
+
driverParam: string;
|
|
590
|
+
notNull: true;
|
|
591
|
+
hasDefault: true;
|
|
592
|
+
isPrimaryKey: true;
|
|
593
|
+
isAutoincrement: false;
|
|
594
|
+
hasRuntimeDefault: false;
|
|
595
|
+
enumValues: undefined;
|
|
596
|
+
baseColumn: never;
|
|
597
|
+
identity: undefined;
|
|
598
|
+
generated: undefined;
|
|
599
|
+
}, {}, {}>;
|
|
600
|
+
gameId: drizzle_orm_pg_core.PgColumn<{
|
|
601
|
+
name: "game_id";
|
|
602
|
+
tableName: "game_custom_hostnames";
|
|
603
|
+
dataType: "string";
|
|
604
|
+
columnType: "PgUUID";
|
|
605
|
+
data: string;
|
|
606
|
+
driverParam: string;
|
|
607
|
+
notNull: true;
|
|
608
|
+
hasDefault: false;
|
|
609
|
+
isPrimaryKey: false;
|
|
610
|
+
isAutoincrement: false;
|
|
611
|
+
hasRuntimeDefault: false;
|
|
612
|
+
enumValues: undefined;
|
|
613
|
+
baseColumn: never;
|
|
614
|
+
identity: undefined;
|
|
615
|
+
generated: undefined;
|
|
616
|
+
}, {}, {}>;
|
|
617
|
+
userId: drizzle_orm_pg_core.PgColumn<{
|
|
618
|
+
name: "user_id";
|
|
619
|
+
tableName: "game_custom_hostnames";
|
|
620
|
+
dataType: "string";
|
|
621
|
+
columnType: "PgText";
|
|
622
|
+
data: string;
|
|
623
|
+
driverParam: string;
|
|
624
|
+
notNull: true;
|
|
625
|
+
hasDefault: false;
|
|
626
|
+
isPrimaryKey: false;
|
|
627
|
+
isAutoincrement: false;
|
|
628
|
+
hasRuntimeDefault: false;
|
|
629
|
+
enumValues: [string, ...string[]];
|
|
630
|
+
baseColumn: never;
|
|
631
|
+
identity: undefined;
|
|
632
|
+
generated: undefined;
|
|
633
|
+
}, {}, {}>;
|
|
634
|
+
hostname: drizzle_orm_pg_core.PgColumn<{
|
|
635
|
+
name: "hostname";
|
|
636
|
+
tableName: "game_custom_hostnames";
|
|
637
|
+
dataType: "string";
|
|
638
|
+
columnType: "PgText";
|
|
639
|
+
data: string;
|
|
640
|
+
driverParam: string;
|
|
641
|
+
notNull: true;
|
|
642
|
+
hasDefault: false;
|
|
643
|
+
isPrimaryKey: false;
|
|
644
|
+
isAutoincrement: false;
|
|
645
|
+
hasRuntimeDefault: false;
|
|
646
|
+
enumValues: [string, ...string[]];
|
|
647
|
+
baseColumn: never;
|
|
648
|
+
identity: undefined;
|
|
649
|
+
generated: undefined;
|
|
650
|
+
}, {}, {}>;
|
|
651
|
+
cloudflareId: drizzle_orm_pg_core.PgColumn<{
|
|
652
|
+
name: "cloudflare_id";
|
|
653
|
+
tableName: "game_custom_hostnames";
|
|
654
|
+
dataType: "string";
|
|
655
|
+
columnType: "PgText";
|
|
656
|
+
data: string;
|
|
657
|
+
driverParam: string;
|
|
658
|
+
notNull: true;
|
|
659
|
+
hasDefault: false;
|
|
660
|
+
isPrimaryKey: false;
|
|
661
|
+
isAutoincrement: false;
|
|
662
|
+
hasRuntimeDefault: false;
|
|
663
|
+
enumValues: [string, ...string[]];
|
|
664
|
+
baseColumn: never;
|
|
665
|
+
identity: undefined;
|
|
666
|
+
generated: undefined;
|
|
667
|
+
}, {}, {}>;
|
|
668
|
+
environment: drizzle_orm_pg_core.PgColumn<{
|
|
669
|
+
name: "environment";
|
|
670
|
+
tableName: "game_custom_hostnames";
|
|
671
|
+
dataType: "string";
|
|
672
|
+
columnType: "PgEnumColumn";
|
|
673
|
+
data: "staging" | "production";
|
|
674
|
+
driverParam: string;
|
|
675
|
+
notNull: true;
|
|
676
|
+
hasDefault: true;
|
|
677
|
+
isPrimaryKey: false;
|
|
678
|
+
isAutoincrement: false;
|
|
679
|
+
hasRuntimeDefault: false;
|
|
680
|
+
enumValues: ["staging", "production"];
|
|
681
|
+
baseColumn: never;
|
|
682
|
+
identity: undefined;
|
|
683
|
+
generated: undefined;
|
|
684
|
+
}, {}, {}>;
|
|
685
|
+
status: drizzle_orm_pg_core.PgColumn<{
|
|
686
|
+
name: "status";
|
|
687
|
+
tableName: "game_custom_hostnames";
|
|
688
|
+
dataType: "string";
|
|
689
|
+
columnType: "PgEnumColumn";
|
|
690
|
+
data: "pending" | "pending_validation" | "pending_deployment" | "pending_deletion" | "active" | "blocked" | "deleted";
|
|
691
|
+
driverParam: string;
|
|
692
|
+
notNull: true;
|
|
693
|
+
hasDefault: true;
|
|
694
|
+
isPrimaryKey: false;
|
|
695
|
+
isAutoincrement: false;
|
|
696
|
+
hasRuntimeDefault: false;
|
|
697
|
+
enumValues: ["pending", "pending_validation", "pending_deployment", "pending_deletion", "active", "blocked", "deleted"];
|
|
698
|
+
baseColumn: never;
|
|
699
|
+
identity: undefined;
|
|
700
|
+
generated: undefined;
|
|
701
|
+
}, {}, {}>;
|
|
702
|
+
sslStatus: drizzle_orm_pg_core.PgColumn<{
|
|
703
|
+
name: "ssl_status";
|
|
704
|
+
tableName: "game_custom_hostnames";
|
|
705
|
+
dataType: "string";
|
|
706
|
+
columnType: "PgEnumColumn";
|
|
707
|
+
data: "pending_validation" | "pending_deployment" | "active" | "deleted" | "initializing" | "pending_issuance";
|
|
708
|
+
driverParam: string;
|
|
709
|
+
notNull: true;
|
|
710
|
+
hasDefault: true;
|
|
711
|
+
isPrimaryKey: false;
|
|
712
|
+
isAutoincrement: false;
|
|
713
|
+
hasRuntimeDefault: false;
|
|
714
|
+
enumValues: ["initializing", "pending_validation", "pending_issuance", "pending_deployment", "active", "deleted"];
|
|
715
|
+
baseColumn: never;
|
|
716
|
+
identity: undefined;
|
|
717
|
+
generated: undefined;
|
|
718
|
+
}, {}, {}>;
|
|
719
|
+
validationRecords: drizzle_orm_pg_core.PgColumn<{
|
|
720
|
+
name: "validation_records";
|
|
721
|
+
tableName: "game_custom_hostnames";
|
|
722
|
+
dataType: "json";
|
|
723
|
+
columnType: "PgJsonb";
|
|
724
|
+
data: CustomHostnameValidationRecords;
|
|
725
|
+
driverParam: unknown;
|
|
726
|
+
notNull: false;
|
|
727
|
+
hasDefault: false;
|
|
728
|
+
isPrimaryKey: false;
|
|
729
|
+
isAutoincrement: false;
|
|
730
|
+
hasRuntimeDefault: false;
|
|
731
|
+
enumValues: undefined;
|
|
732
|
+
baseColumn: never;
|
|
733
|
+
identity: undefined;
|
|
734
|
+
generated: undefined;
|
|
735
|
+
}, {}, {
|
|
736
|
+
$type: CustomHostnameValidationRecords;
|
|
737
|
+
}>;
|
|
738
|
+
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
739
|
+
name: "created_at";
|
|
740
|
+
tableName: "game_custom_hostnames";
|
|
741
|
+
dataType: "date";
|
|
742
|
+
columnType: "PgTimestamp";
|
|
743
|
+
data: Date;
|
|
744
|
+
driverParam: string;
|
|
745
|
+
notNull: true;
|
|
746
|
+
hasDefault: true;
|
|
747
|
+
isPrimaryKey: false;
|
|
748
|
+
isAutoincrement: false;
|
|
749
|
+
hasRuntimeDefault: false;
|
|
750
|
+
enumValues: undefined;
|
|
751
|
+
baseColumn: never;
|
|
752
|
+
identity: undefined;
|
|
753
|
+
generated: undefined;
|
|
754
|
+
}, {}, {}>;
|
|
755
|
+
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
756
|
+
name: "updated_at";
|
|
757
|
+
tableName: "game_custom_hostnames";
|
|
758
|
+
dataType: "date";
|
|
759
|
+
columnType: "PgTimestamp";
|
|
760
|
+
data: Date;
|
|
761
|
+
driverParam: string;
|
|
762
|
+
notNull: true;
|
|
763
|
+
hasDefault: true;
|
|
764
|
+
isPrimaryKey: false;
|
|
765
|
+
isAutoincrement: false;
|
|
766
|
+
hasRuntimeDefault: false;
|
|
767
|
+
enumValues: undefined;
|
|
768
|
+
baseColumn: never;
|
|
769
|
+
identity: undefined;
|
|
770
|
+
generated: undefined;
|
|
771
|
+
}, {}, {}>;
|
|
772
|
+
};
|
|
773
|
+
dialect: "pg";
|
|
774
|
+
}>;
|
|
557
775
|
declare const items: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
558
776
|
name: "items";
|
|
559
777
|
schema: undefined;
|
|
@@ -648,7 +866,7 @@ declare const items: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
648
866
|
tableName: "items";
|
|
649
867
|
dataType: "string";
|
|
650
868
|
columnType: "PgEnumColumn";
|
|
651
|
-
data: "
|
|
869
|
+
data: "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "accessory" | "other";
|
|
652
870
|
driverParam: string;
|
|
653
871
|
notNull: true;
|
|
654
872
|
hasDefault: true;
|
|
@@ -1892,7 +2110,7 @@ declare const characterComponents: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
1892
2110
|
tableName: "character_components";
|
|
1893
2111
|
dataType: "string";
|
|
1894
2112
|
columnType: "PgEnumColumn";
|
|
1895
|
-
data: "
|
|
2113
|
+
data: "accessory" | "body" | "outfit" | "hairstyle" | "eyes";
|
|
1896
2114
|
driverParam: string;
|
|
1897
2115
|
notNull: true;
|
|
1898
2116
|
hasDefault: false;
|
|
@@ -2959,66 +3177,32 @@ declare const UpsertGameMetadataSchema: z.ZodEffects<z.ZodObject<{
|
|
|
2959
3177
|
mapElementId?: string | null | undefined;
|
|
2960
3178
|
metadata?: Record<string, unknown> | undefined;
|
|
2961
3179
|
}>;
|
|
3180
|
+
/**
|
|
3181
|
+
* Simplified game manifest for Cloudflare Workers deployments
|
|
3182
|
+
*
|
|
3183
|
+
* The manifest is auto-generated by build tools (Godot plugin, Vite plugin, etc.)
|
|
3184
|
+
* and provides minimal metadata about the build.
|
|
3185
|
+
*
|
|
3186
|
+
* Fields:
|
|
3187
|
+
* - version: Manifest schema version (for future migrations)
|
|
3188
|
+
* - platform: Auto-detected by build tool (e.g., 'web', 'godot@4.3', 'unity@2023')
|
|
3189
|
+
* - createdAt: Build timestamp (ISO 8601)
|
|
3190
|
+
*
|
|
3191
|
+
* Note: With unified Cloudflare Workers deployments, the worker handles all routing
|
|
3192
|
+
* internally, so we no longer need bootMode, entryPoint, or styles fields.
|
|
3193
|
+
*/
|
|
2962
3194
|
declare const ManifestV1Schema: z.ZodObject<{
|
|
2963
3195
|
version: z.ZodString;
|
|
2964
|
-
|
|
2965
|
-
entryPoint: z.ZodEffects<z.ZodString, string, string>;
|
|
2966
|
-
/**
|
|
2967
|
-
* An array of relative paths to CSS stylesheets.
|
|
2968
|
-
* Currently, this property is ONLY utilized by the 'module' boot mode
|
|
2969
|
-
* (`apps/cademy/src/lib/loader/boot-module.ts`) to load external
|
|
2970
|
-
* stylesheets into the game's shadow DOM.
|
|
2971
|
-
*
|
|
2972
|
-
* This property is under review for potential deprecation and removal.
|
|
2973
|
-
* The 'module' boot mode itself has not yet seen significant adoption
|
|
2974
|
-
* or clear use-cases, and if support for module loading is removed in
|
|
2975
|
-
* the future, this 'styles' property would become obsolete.
|
|
2976
|
-
*
|
|
2977
|
-
* If module-based games need styling, alternative approaches might involve
|
|
2978
|
-
* bundling CSS within their JavaScript or managing style injection internally.
|
|
2979
|
-
*/
|
|
2980
|
-
styles: z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodString, "many">>, string[] | undefined, string[] | undefined>;
|
|
2981
|
-
/**
|
|
2982
|
-
* Specifies the game or development platform.
|
|
2983
|
-
* Current values include 'web', 'godot', and 'unity'.
|
|
2984
|
-
* The default in the database is 'web'.
|
|
2985
|
-
*
|
|
2986
|
-
* IMPORTANT: This property is NOT CURRENTLY USED by the core loader
|
|
2987
|
-
* or runtime systems in any functional way. It is present in the manifest
|
|
2988
|
-
* but does not drive any specific behavior in `boot-iframe.ts` or
|
|
2989
|
-
* `boot-module.ts` beyond being a piece of metadata.
|
|
2990
|
-
*
|
|
2991
|
-
* Potential Future Uses (Speculative):
|
|
2992
|
-
* - Analytics: Could be used to gather stats on platform popularity/usage.
|
|
2993
|
-
* - Developer Portal: Might inform UI/UX in the dev portal, e.g., showing
|
|
2994
|
-
* platform-specific guides or settings.
|
|
2995
|
-
* - Loader Optimizations: In the future, the loader could potentially use this
|
|
2996
|
-
* to apply platform-specific loading strategies or workarounds, though this
|
|
2997
|
-
* is unlikely given the current generic boot process.
|
|
2998
|
-
* - Asset Pipeline: Could hint to future asset pipeline tools about expected
|
|
2999
|
-
* project structures or build artifacts for different platforms.
|
|
3000
|
-
*
|
|
3001
|
-
* The field is intentionally kept somewhat generic. If finer-grained
|
|
3002
|
-
* distinctions are ever needed (e.g., specific web frameworks like 'phaser',
|
|
3003
|
-
* 'three'), this schema might need to be revisited or a separate
|
|
3004
|
-
* 'platformVersion' or 'framework' field could be added.
|
|
3005
|
-
*/
|
|
3006
|
-
platform: z.ZodEnum<["web", "godot", "unity"]>;
|
|
3196
|
+
platform: z.ZodString;
|
|
3007
3197
|
createdAt: z.ZodString;
|
|
3008
3198
|
}, "strip", z.ZodTypeAny, {
|
|
3009
3199
|
createdAt: string;
|
|
3010
3200
|
version: string;
|
|
3011
|
-
platform:
|
|
3012
|
-
bootMode: "iframe" | "module";
|
|
3013
|
-
entryPoint: string;
|
|
3014
|
-
styles?: string[] | undefined;
|
|
3201
|
+
platform: string;
|
|
3015
3202
|
}, {
|
|
3016
3203
|
createdAt: string;
|
|
3017
3204
|
version: string;
|
|
3018
|
-
platform:
|
|
3019
|
-
bootMode: "iframe" | "module";
|
|
3020
|
-
entryPoint: string;
|
|
3021
|
-
styles?: string[] | undefined;
|
|
3205
|
+
platform: string;
|
|
3022
3206
|
}>;
|
|
3023
3207
|
declare const InsertItemSchema: drizzle_zod.BuildSchema<"insert", {
|
|
3024
3208
|
id: drizzle_orm_pg_core.PgColumn<{
|
|
@@ -3111,7 +3295,7 @@ declare const InsertItemSchema: drizzle_zod.BuildSchema<"insert", {
|
|
|
3111
3295
|
tableName: "items";
|
|
3112
3296
|
dataType: "string";
|
|
3113
3297
|
columnType: "PgEnumColumn";
|
|
3114
|
-
data: "
|
|
3298
|
+
data: "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "accessory" | "other";
|
|
3115
3299
|
driverParam: string;
|
|
3116
3300
|
notNull: true;
|
|
3117
3301
|
hasDefault: true;
|
|
@@ -3207,21 +3391,21 @@ declare const UpdateItemSchema: z.ZodObject<Omit<{
|
|
|
3207
3391
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3208
3392
|
createdAt: z.ZodOptional<z.ZodDate>;
|
|
3209
3393
|
}, "id" | "createdAt">, "strip", z.ZodTypeAny, {
|
|
3394
|
+
slug?: string | undefined;
|
|
3210
3395
|
description?: string | null | undefined;
|
|
3211
3396
|
displayName?: string | undefined;
|
|
3212
|
-
slug?: string | undefined;
|
|
3213
3397
|
metadata?: Record<string, unknown> | undefined;
|
|
3214
3398
|
gameId?: string | null | undefined;
|
|
3215
|
-
type?: "
|
|
3399
|
+
type?: "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "accessory" | "other" | undefined;
|
|
3216
3400
|
isPlaceable?: boolean | undefined;
|
|
3217
3401
|
imageUrl?: string | null | undefined;
|
|
3218
3402
|
}, {
|
|
3403
|
+
slug?: string | undefined;
|
|
3219
3404
|
description?: string | null | undefined;
|
|
3220
3405
|
displayName?: string | undefined;
|
|
3221
|
-
slug?: string | undefined;
|
|
3222
3406
|
metadata?: Record<string, unknown> | undefined;
|
|
3223
3407
|
gameId?: string | null | undefined;
|
|
3224
|
-
type?: "
|
|
3408
|
+
type?: "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "accessory" | "other" | undefined;
|
|
3225
3409
|
isPlaceable?: boolean | undefined;
|
|
3226
3410
|
imageUrl?: string | null | undefined;
|
|
3227
3411
|
}>;
|
|
@@ -3267,10 +3451,10 @@ declare const InsertShopListingSchema: z.ZodObject<Omit<{
|
|
|
3267
3451
|
createdAt: z.ZodOptional<z.ZodDate>;
|
|
3268
3452
|
updatedAt: z.ZodOptional<z.ZodNullable<z.ZodDate>>;
|
|
3269
3453
|
}, "id" | "createdAt" | "updatedAt">, "strip", z.ZodTypeAny, {
|
|
3454
|
+
isActive: boolean;
|
|
3270
3455
|
itemId: string;
|
|
3271
3456
|
currencyId: string;
|
|
3272
3457
|
price: number;
|
|
3273
|
-
isActive: boolean;
|
|
3274
3458
|
sellBackPercentage?: number | null | undefined;
|
|
3275
3459
|
stock?: number | null | undefined;
|
|
3276
3460
|
availableFrom?: Date | null | undefined;
|
|
@@ -3279,37 +3463,37 @@ declare const InsertShopListingSchema: z.ZodObject<Omit<{
|
|
|
3279
3463
|
itemId: string;
|
|
3280
3464
|
currencyId: string;
|
|
3281
3465
|
price: number;
|
|
3466
|
+
isActive?: boolean | undefined;
|
|
3282
3467
|
sellBackPercentage?: number | null | undefined;
|
|
3283
3468
|
stock?: number | null | undefined;
|
|
3284
|
-
isActive?: boolean | undefined;
|
|
3285
3469
|
availableFrom?: Date | null | undefined;
|
|
3286
3470
|
availableUntil?: Date | null | undefined;
|
|
3287
3471
|
}>;
|
|
3288
3472
|
declare const UpdateShopListingSchema: z.ZodObject<{
|
|
3473
|
+
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
3289
3474
|
itemId: z.ZodOptional<z.ZodString>;
|
|
3290
3475
|
currencyId: z.ZodOptional<z.ZodString>;
|
|
3291
3476
|
price: z.ZodOptional<z.ZodNumber>;
|
|
3292
3477
|
sellBackPercentage: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNumber>>>;
|
|
3293
3478
|
stock: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodNumber>>>;
|
|
3294
|
-
isActive: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
|
|
3295
3479
|
availableFrom: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodDate>>>;
|
|
3296
3480
|
availableUntil: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodDate>>>;
|
|
3297
3481
|
}, "strip", z.ZodTypeAny, {
|
|
3482
|
+
isActive?: boolean | undefined;
|
|
3298
3483
|
itemId?: string | undefined;
|
|
3299
3484
|
currencyId?: string | undefined;
|
|
3300
3485
|
price?: number | undefined;
|
|
3301
3486
|
sellBackPercentage?: number | null | undefined;
|
|
3302
3487
|
stock?: number | null | undefined;
|
|
3303
|
-
isActive?: boolean | undefined;
|
|
3304
3488
|
availableFrom?: Date | null | undefined;
|
|
3305
3489
|
availableUntil?: Date | null | undefined;
|
|
3306
3490
|
}, {
|
|
3491
|
+
isActive?: boolean | undefined;
|
|
3307
3492
|
itemId?: string | undefined;
|
|
3308
3493
|
currencyId?: string | undefined;
|
|
3309
3494
|
price?: number | undefined;
|
|
3310
3495
|
sellBackPercentage?: number | null | undefined;
|
|
3311
3496
|
stock?: number | null | undefined;
|
|
3312
|
-
isActive?: boolean | undefined;
|
|
3313
3497
|
availableFrom?: Date | null | undefined;
|
|
3314
3498
|
availableUntil?: Date | null | undefined;
|
|
3315
3499
|
}>;
|
|
@@ -3397,32 +3581,22 @@ type PlayerCharacter = typeof playerCharacters.$inferSelect & {
|
|
|
3397
3581
|
};
|
|
3398
3582
|
type PlayerCharacterAccessory = typeof playerCharacterAccessories.$inferSelect;
|
|
3399
3583
|
type GameRow = typeof games.$inferSelect;
|
|
3400
|
-
type BaseGame = Omit<GameRow, 'gameType' | '
|
|
3584
|
+
type BaseGame = Omit<GameRow, 'gameType' | 'deploymentUrl' | 'externalUrl'>;
|
|
3401
3585
|
type HostedGame = BaseGame & {
|
|
3402
3586
|
gameType: 'hosted';
|
|
3403
|
-
|
|
3587
|
+
deploymentUrl: string;
|
|
3404
3588
|
externalUrl: null;
|
|
3405
3589
|
};
|
|
3406
3590
|
type ExternalGame = BaseGame & {
|
|
3407
3591
|
gameType: 'external';
|
|
3408
|
-
|
|
3592
|
+
deploymentUrl: null;
|
|
3409
3593
|
externalUrl: string;
|
|
3410
3594
|
};
|
|
3411
3595
|
type Game = HostedGame | ExternalGame;
|
|
3412
3596
|
type GameSession = typeof gameSessions.$inferSelect;
|
|
3413
3597
|
type GameStateData = Record<string, unknown>;
|
|
3598
|
+
type GameCustomHostname = typeof gameCustomHostnames.$inferSelect;
|
|
3414
3599
|
type UpsertGameMetadataInput = z.infer<typeof UpsertGameMetadataSchema>;
|
|
3415
|
-
/**
|
|
3416
|
-
* Response from backend deployment API
|
|
3417
|
-
*/
|
|
3418
|
-
interface BackendDeploymentResponse {
|
|
3419
|
-
/** Unique deployment ID */
|
|
3420
|
-
deploymentId: string;
|
|
3421
|
-
/** Backend API URL */
|
|
3422
|
-
url: string;
|
|
3423
|
-
/** Deployment timestamp */
|
|
3424
|
-
deployedAt: string;
|
|
3425
|
-
}
|
|
3426
3600
|
type Item = typeof items.$inferSelect;
|
|
3427
3601
|
type InventoryItem = typeof inventoryItems.$inferSelect;
|
|
3428
3602
|
type Currency = typeof currencies.$inferSelect;
|
|
@@ -3509,10 +3683,12 @@ type CharacterComponentWithSpriteUrl = CharacterComponent & {
|
|
|
3509
3683
|
type InventoryItemWithItem = Omit<InventoryItem, 'itemId'> & {
|
|
3510
3684
|
item: Item;
|
|
3511
3685
|
};
|
|
3512
|
-
|
|
3513
|
-
|
|
3686
|
+
/**
|
|
3687
|
+
* Game with optional manifest metadata from build tools
|
|
3688
|
+
*/
|
|
3689
|
+
type FetchedGame = (HostedGame | ExternalGame | GameRow) & {
|
|
3690
|
+
manifest?: ManifestV1;
|
|
3514
3691
|
};
|
|
3515
|
-
type FetchedGame = HostedGameWithManifest | GameRow;
|
|
3516
3692
|
/**
|
|
3517
3693
|
* Map-related Composite Types
|
|
3518
3694
|
* Types that combine map, game, and item data for rendering and interaction
|
|
@@ -3933,6 +4109,8 @@ interface IntegrationsConfig {
|
|
|
3933
4109
|
kv?: boolean;
|
|
3934
4110
|
/** Bucket storage (optional) */
|
|
3935
4111
|
bucket?: boolean;
|
|
4112
|
+
/** Authentication (optional) */
|
|
4113
|
+
auth?: boolean;
|
|
3936
4114
|
}
|
|
3937
4115
|
/**
|
|
3938
4116
|
* Unified Playcademy configuration
|
|
@@ -4552,15 +4730,17 @@ declare class PlaycademyClient {
|
|
|
4552
4730
|
get: () => Promise<DeveloperStatusValue>;
|
|
4553
4731
|
};
|
|
4554
4732
|
games: {
|
|
4555
|
-
deploy: {
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4733
|
+
deploy: (slug: string, options: {
|
|
4734
|
+
metadata?: UpsertGameMetadataInput;
|
|
4735
|
+
file?: File | Blob | null;
|
|
4736
|
+
backend?: BackendDeploymentBundle;
|
|
4737
|
+
hooks?: DevUploadHooks;
|
|
4738
|
+
}) => Promise<Game>;
|
|
4739
|
+
seed: (slug: string, code: string, environment?: "staging" | "production") => Promise<{
|
|
4740
|
+
success: boolean;
|
|
4741
|
+
deploymentId: string;
|
|
4742
|
+
executedAt: string;
|
|
4743
|
+
}>;
|
|
4564
4744
|
upsert: (slug: string, metadata: UpsertGameMetadataInput) => Promise<Game>;
|
|
4565
4745
|
delete: (gameId: string) => Promise<void>;
|
|
4566
4746
|
secrets: {
|
|
@@ -4586,6 +4766,12 @@ declare class PlaycademyClient {
|
|
|
4586
4766
|
put: (slug: string, key: string, content: Blob | ArrayBuffer | Uint8Array, contentType?: string) => Promise<void>;
|
|
4587
4767
|
delete: (slug: string, key: string) => Promise<void>;
|
|
4588
4768
|
};
|
|
4769
|
+
domains: {
|
|
4770
|
+
add: (slug: string, hostname: string) => Promise<GameCustomHostname>;
|
|
4771
|
+
list: (slug: string) => Promise<GameCustomHostname[]>;
|
|
4772
|
+
status: (slug: string, hostname: string, refresh?: boolean) => Promise<GameCustomHostname>;
|
|
4773
|
+
delete: (slug: string, hostname: string) => Promise<void>;
|
|
4774
|
+
};
|
|
4589
4775
|
};
|
|
4590
4776
|
items: {
|
|
4591
4777
|
create: (gameId: string, slug: string, itemData: Omit<InsertItemInput, "slug" | "gameId">) => Promise<Item>;
|
|
@@ -4622,10 +4808,10 @@ declare class PlaycademyClient {
|
|
|
4622
4808
|
};
|
|
4623
4809
|
items: {
|
|
4624
4810
|
create: (props: InsertItemInput) => Promise<{
|
|
4625
|
-
metadata: unknown;
|
|
4626
4811
|
type: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
|
|
4627
|
-
slug: string;
|
|
4628
4812
|
id: string;
|
|
4813
|
+
metadata: unknown;
|
|
4814
|
+
slug: string;
|
|
4629
4815
|
createdAt: Date;
|
|
4630
4816
|
gameId: string | null;
|
|
4631
4817
|
displayName: string;
|
|
@@ -4634,10 +4820,10 @@ declare class PlaycademyClient {
|
|
|
4634
4820
|
imageUrl: string | null;
|
|
4635
4821
|
}>;
|
|
4636
4822
|
get: (itemId: string) => Promise<{
|
|
4637
|
-
metadata: unknown;
|
|
4638
4823
|
type: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
|
|
4639
|
-
slug: string;
|
|
4640
4824
|
id: string;
|
|
4825
|
+
metadata: unknown;
|
|
4826
|
+
slug: string;
|
|
4641
4827
|
createdAt: Date;
|
|
4642
4828
|
gameId: string | null;
|
|
4643
4829
|
displayName: string;
|
|
@@ -4646,10 +4832,10 @@ declare class PlaycademyClient {
|
|
|
4646
4832
|
imageUrl: string | null;
|
|
4647
4833
|
}>;
|
|
4648
4834
|
list: () => Promise<{
|
|
4649
|
-
metadata: unknown;
|
|
4650
4835
|
type: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
|
|
4651
|
-
slug: string;
|
|
4652
4836
|
id: string;
|
|
4837
|
+
metadata: unknown;
|
|
4838
|
+
slug: string;
|
|
4653
4839
|
createdAt: Date;
|
|
4654
4840
|
gameId: string | null;
|
|
4655
4841
|
displayName: string;
|
|
@@ -4658,10 +4844,10 @@ declare class PlaycademyClient {
|
|
|
4658
4844
|
imageUrl: string | null;
|
|
4659
4845
|
}[]>;
|
|
4660
4846
|
update: (itemId: string, props: UpdateItemInput) => Promise<{
|
|
4661
|
-
metadata: unknown;
|
|
4662
4847
|
type: "accessory" | "currency" | "badge" | "trophy" | "collectible" | "consumable" | "unlock" | "upgrade" | "other";
|
|
4663
|
-
slug: string;
|
|
4664
4848
|
id: string;
|
|
4849
|
+
metadata: unknown;
|
|
4850
|
+
slug: string;
|
|
4665
4851
|
createdAt: Date;
|
|
4666
4852
|
gameId: string | null;
|
|
4667
4853
|
displayName: string;
|
|
@@ -4925,12 +5111,16 @@ interface ClientConfig {
|
|
|
4925
5111
|
autoStartSession?: boolean;
|
|
4926
5112
|
}
|
|
4927
5113
|
interface InitPayload {
|
|
5114
|
+
/** Hub API base URL */
|
|
4928
5115
|
baseUrl: string;
|
|
5116
|
+
/** Game deployment URL (serves both frontend assets and backend API) */
|
|
4929
5117
|
gameUrl?: string;
|
|
5118
|
+
/** Short-lived game token */
|
|
4930
5119
|
token: string;
|
|
5120
|
+
/** Game ID */
|
|
4931
5121
|
gameId: string;
|
|
5122
|
+
/** Realtime WebSocket URL */
|
|
4932
5123
|
realtimeUrl?: string;
|
|
4933
|
-
cdnBase?: string;
|
|
4934
5124
|
}
|
|
4935
5125
|
type AuthProviderType = (typeof AUTH_PROVIDER_IDS)[keyof typeof AUTH_PROVIDER_IDS];
|
|
4936
5126
|
interface AuthOptions {
|
|
@@ -5178,4 +5368,4 @@ interface BucketFile {
|
|
|
5178
5368
|
}
|
|
5179
5369
|
|
|
5180
5370
|
export { PlaycademyClient };
|
|
5181
|
-
export type { Achievement, AchievementCurrent, AchievementProgressResponse, AuthCallbackPayload, AuthOptions, AuthProviderType, AuthResult, AuthServerMessage, AuthStateChangePayload, AuthStateUpdate, AuthenticatedUser, BetterAuthApiKey, BetterAuthApiKeyResponse, BetterAuthSignInResponse, BucketFile, CharacterComponent, CharacterComponentWithSpriteUrl, ClientConfig, ClientEvents, Currency, DevUploadEvent, DevUploadHooks, DeveloperStatusResponse, EventListeners, ExternalGame, Game, GameContextPayload, GameLeaderboardEntry, GameSession, GameStateData, GameTokenResponse, GameUser, HostedGame,
|
|
5371
|
+
export type { Achievement, AchievementCurrent, AchievementProgressResponse, AuthCallbackPayload, AuthOptions, AuthProviderType, AuthResult, AuthServerMessage, AuthStateChangePayload, AuthStateUpdate, AuthenticatedUser, BetterAuthApiKey, BetterAuthApiKeyResponse, BetterAuthSignInResponse, BucketFile, CharacterComponent, CharacterComponentWithSpriteUrl, ClientConfig, ClientEvents, Currency, DevUploadEvent, DevUploadHooks, DeveloperStatusResponse, EventListeners, ExternalGame, FetchedGame, Game, GameContextPayload, GameLeaderboardEntry, GameSession, GameStateData, GameTokenResponse, GameUser, HostedGame, InitPayload, InventoryItem, InventoryItemWithItem, InventoryMutationResponse, Item, KeyEventPayload, LeaderboardEntry, LevelConfig, LoginResponse, ManifestV1, Map, MapElement, MapElementWithGame, MapObject, MapObjectWithItem, PlaycademyServerClientConfig, PlaycademyServerClientState, PlayerCharacter, ShopCurrency, ShopDisplayItem, ShopViewResponse, SpriteTemplate, SpriteTemplateData, StartSessionResponse, TelemetryPayload, TodayXpResponse, TokenRefreshPayload, TokenType, TotalXpResponse, User, UserInfo, UserLevel, UserLevelWithConfig, UserRank, UserRankResponse, UserRoleEnumType, UserScore$1 as UserScore, XpHistoryResponse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playcademy/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -42,11 +42,10 @@
|
|
|
42
42
|
"@playcademy/timeback": "0.0.1",
|
|
43
43
|
"@playcademy/utils": "0.0.1",
|
|
44
44
|
"@types/bun": "latest",
|
|
45
|
-
"playcademy": "0.14.
|
|
45
|
+
"playcademy": "0.14.4",
|
|
46
46
|
"rollup": "^4.50.2",
|
|
47
47
|
"rollup-plugin-dts": "^6.2.3",
|
|
48
|
-
"typescript": "^5.7.2"
|
|
49
|
-
"yocto-spinner": "^0.2.2"
|
|
48
|
+
"typescript": "^5.7.2"
|
|
50
49
|
},
|
|
51
50
|
"peerDependencies": {
|
|
52
51
|
"drizzle-orm": "^0.42.0",
|