playcademy 0.11.2 → 0.11.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/dist/constants.d.ts +3 -15
- package/dist/constants.js +48 -5
- package/dist/edge-play/src/constants.ts +6 -25
- package/dist/index.js +3652 -308
- package/dist/utils.js +42 -8
- package/package.json +3 -2
package/dist/constants.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { GAME_WORKER_DOMAINS, PLAYCADEMY_BASE_URLS, PLAYCADEMY_DOMAINS } from '@playcademy/constants';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* HTTP server constants for CLI OAuth callback handling
|
|
3
5
|
*/
|
|
@@ -23,18 +25,4 @@ declare const DEFAULT_PORTS: {
|
|
|
23
25
|
*/
|
|
24
26
|
declare const CONFIG_FILE_NAMES: string[];
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
* Base URLs for Playcademy platform environments
|
|
28
|
-
*/
|
|
29
|
-
declare const PLAYCADEMY_BASE_URLS: {
|
|
30
|
-
readonly staging: "https://hub.dev.playcademy.net";
|
|
31
|
-
readonly production: "https://hub.playcademy.com";
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Game backend domain for deployed Workers
|
|
35
|
-
* Staging games use {slug}-staging.playcademy.gg
|
|
36
|
-
* Production games use {slug}.playcademy.gg
|
|
37
|
-
*/
|
|
38
|
-
declare const GAME_BACKEND_DOMAIN: "playcademy.gg";
|
|
39
|
-
|
|
40
|
-
export { CALLBACK_PATH, CALLBACK_PORT, CONFIG_FILE_NAMES, DEFAULT_PORTS, GAME_BACKEND_DOMAIN, PLAYCADEMY_BASE_URLS, SSO_AUTH_TIMEOUT_MS };
|
|
28
|
+
export { CALLBACK_PATH, CALLBACK_PORT, CONFIG_FILE_NAMES, DEFAULT_PORTS, SSO_AUTH_TIMEOUT_MS };
|
package/dist/constants.js
CHANGED
|
@@ -18,18 +18,61 @@ var CONFIG_FILE_NAMES = [
|
|
|
18
18
|
"playcademy.config.mjs"
|
|
19
19
|
];
|
|
20
20
|
|
|
21
|
-
// src/
|
|
21
|
+
// ../constants/src/domains.ts
|
|
22
|
+
var PLAYCADEMY_DOMAINS = {
|
|
23
|
+
/** Primary domain (hub, landing pages) */
|
|
24
|
+
apex: "playcademy.net",
|
|
25
|
+
/** Marketing/alternative domain */
|
|
26
|
+
apexAlt: "playcademy.com",
|
|
27
|
+
/** Game backend worker domain */
|
|
28
|
+
games: "playcademy.gg"
|
|
29
|
+
};
|
|
22
30
|
var PLAYCADEMY_BASE_URLS = {
|
|
23
|
-
|
|
24
|
-
|
|
31
|
+
production: "https://hub.playcademy.net",
|
|
32
|
+
staging: "https://hub.dev.playcademy.net"
|
|
33
|
+
};
|
|
34
|
+
var GAME_WORKER_DOMAINS = {
|
|
35
|
+
production: "playcademy.gg",
|
|
36
|
+
staging: "staging.playcademy.gg"
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// ../constants/src/overworld.ts
|
|
40
|
+
var ITEM_SLUGS = {
|
|
41
|
+
/** Primary platform currency */
|
|
42
|
+
PLAYCADEMY_CREDITS: "PLAYCADEMY_CREDITS",
|
|
43
|
+
/** Experience points currency */
|
|
44
|
+
PLAYCADEMY_XP: "PLAYCADEMY_XP",
|
|
45
|
+
/** Core platform badges */
|
|
46
|
+
FOUNDING_MEMBER_BADGE: "FOUNDING_MEMBER_BADGE",
|
|
47
|
+
EARLY_ADOPTER_BADGE: "EARLY_ADOPTER_BADGE",
|
|
48
|
+
FIRST_GAME_BADGE: "FIRST_GAME_BADGE",
|
|
49
|
+
/** Example items */
|
|
50
|
+
COMMON_SWORD: "COMMON_SWORD",
|
|
51
|
+
SMALL_HEALTH_POTION: "SMALL_HEALTH_POTION",
|
|
52
|
+
SMALL_BACKPACK: "SMALL_BACKPACK",
|
|
53
|
+
/** Placeable items */
|
|
54
|
+
LAVA_LAMP: "LAVA_LAMP",
|
|
55
|
+
BOOMBOX: "BOOMBOX",
|
|
56
|
+
CABIN_BED: "CABIN_BED"
|
|
57
|
+
};
|
|
58
|
+
var CURRENCIES = {
|
|
59
|
+
/** Primary platform currency slug */
|
|
60
|
+
PRIMARY: ITEM_SLUGS.PLAYCADEMY_CREDITS,
|
|
61
|
+
/** Experience points slug */
|
|
62
|
+
XP: ITEM_SLUGS.PLAYCADEMY_XP
|
|
63
|
+
};
|
|
64
|
+
var BADGES = {
|
|
65
|
+
FOUNDING_MEMBER: ITEM_SLUGS.FOUNDING_MEMBER_BADGE,
|
|
66
|
+
EARLY_ADOPTER: ITEM_SLUGS.EARLY_ADOPTER_BADGE,
|
|
67
|
+
FIRST_GAME: ITEM_SLUGS.FIRST_GAME_BADGE
|
|
25
68
|
};
|
|
26
|
-
var GAME_BACKEND_DOMAIN = "playcademy.gg";
|
|
27
69
|
export {
|
|
28
70
|
CALLBACK_PATH,
|
|
29
71
|
CALLBACK_PORT,
|
|
30
72
|
CONFIG_FILE_NAMES,
|
|
31
73
|
DEFAULT_PORTS,
|
|
32
|
-
|
|
74
|
+
GAME_WORKER_DOMAINS,
|
|
33
75
|
PLAYCADEMY_BASE_URLS,
|
|
76
|
+
PLAYCADEMY_DOMAINS,
|
|
34
77
|
SSO_AUTH_TIMEOUT_MS
|
|
35
78
|
};
|
|
@@ -2,17 +2,12 @@
|
|
|
2
2
|
* Constants for game backend workers
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { TIMEBACK_ROUTES, WORKER_ENV_VARS, WORKER_NAMING } from '@playcademy/constants'
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
|
-
*
|
|
8
|
+
* Re-export shared constants from @playcademy/constants
|
|
7
9
|
*/
|
|
8
|
-
export
|
|
9
|
-
/** Game-specific API key for calling platform API */
|
|
10
|
-
PLAYCADEMY_API_KEY: 'PLAYCADEMY_API_KEY',
|
|
11
|
-
/** Game ID (UUID) */
|
|
12
|
-
GAME_ID: 'GAME_ID',
|
|
13
|
-
/** Platform API base URL */
|
|
14
|
-
PLAYCADEMY_BASE_URL: 'PLAYCADEMY_BASE_URL',
|
|
15
|
-
} as const
|
|
10
|
+
export { WORKER_ENV_VARS as ENV_VARS, WORKER_NAMING }
|
|
16
11
|
|
|
17
12
|
/**
|
|
18
13
|
* Built-in API routes
|
|
@@ -23,20 +18,6 @@ export const ROUTES = {
|
|
|
23
18
|
/** Route index (lists available routes) */
|
|
24
19
|
INDEX: '/api',
|
|
25
20
|
|
|
26
|
-
/** TimeBack integration routes */
|
|
27
|
-
TIMEBACK:
|
|
28
|
-
PROGRESS: '/api/integrations/timeback/progress',
|
|
29
|
-
SESSION_END: '/api/integrations/timeback/session-end',
|
|
30
|
-
AWARD_XP: '/api/integrations/timeback/award-xp',
|
|
31
|
-
},
|
|
32
|
-
} as const
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Worker naming patterns
|
|
36
|
-
*/
|
|
37
|
-
export const WORKER_NAMING = {
|
|
38
|
-
/** Staging workers are prefixed to avoid namespace collisions */
|
|
39
|
-
STAGING_PREFIX: 'staging-',
|
|
40
|
-
/** Staging subdomain suffix */
|
|
41
|
-
STAGING_SUFFIX: '-staging',
|
|
21
|
+
/** TimeBack integration routes (imported from @playcademy/constants) */
|
|
22
|
+
TIMEBACK: TIMEBACK_ROUTES,
|
|
42
23
|
} as const
|