glitch-javascript-sdk 3.8.13 → 3.9.0
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/cjs/index.js +123 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Hosting.d.ts +133 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +6651 -7021
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/HostingRoute.d.ts +8 -0
- package/dist/index.d.ts +57 -0
- package/package.json +2 -2
- package/src/api/Hosting.ts +223 -0
- package/src/api/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/routes/HostingRoute.ts +33 -0
package/dist/index.d.ts
CHANGED
|
@@ -11525,6 +11525,62 @@ declare class GameAdvertising {
|
|
|
11525
11525
|
static adminUpsertProviderApp<T>(data: GameAdProviderApp): AxiosPromise<Response<T>>;
|
|
11526
11526
|
}
|
|
11527
11527
|
|
|
11528
|
+
type HostingMode = 'static' | 'server';
|
|
11529
|
+
type HostingDatabaseEngine = 'postgresql' | 'mysql' | 'azure_sql' | 'cosmos_nosql';
|
|
11530
|
+
type HostingDatabasePlan = 'sandbox' | 'launch' | 'growth' | 'scale' | 'dedicated';
|
|
11531
|
+
interface CreateHostingSiteRequest {
|
|
11532
|
+
name: string;
|
|
11533
|
+
slug: string;
|
|
11534
|
+
mode: HostingMode;
|
|
11535
|
+
azure_region?: string;
|
|
11536
|
+
}
|
|
11537
|
+
interface CreateHostingReleaseRequest {
|
|
11538
|
+
version: string;
|
|
11539
|
+
source_type: 'upload' | 'cli' | 'game_build';
|
|
11540
|
+
blob_path?: string;
|
|
11541
|
+
game_build_id?: string;
|
|
11542
|
+
entry_point?: string;
|
|
11543
|
+
}
|
|
11544
|
+
interface CreateHostingDatabaseRequest {
|
|
11545
|
+
name: string;
|
|
11546
|
+
engine: HostingDatabaseEngine;
|
|
11547
|
+
plan: HostingDatabasePlan;
|
|
11548
|
+
azure_region: string;
|
|
11549
|
+
auto_grow_enabled?: boolean;
|
|
11550
|
+
high_availability_enabled?: boolean;
|
|
11551
|
+
}
|
|
11552
|
+
/**
|
|
11553
|
+
* Typed SDK for game website hosting, Azure database add-ons, domains, usage,
|
|
11554
|
+
* deployment instructions, and hosted-play attribution.
|
|
11555
|
+
*/
|
|
11556
|
+
declare class Hosting {
|
|
11557
|
+
static catalog<T>(): AxiosPromise<Response<T>>;
|
|
11558
|
+
static dashboard<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
11559
|
+
static channelAnalytics<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
11560
|
+
static createSite<T>(title_id: string, data: CreateHostingSiteRequest): AxiosPromise<Response<T>>;
|
|
11561
|
+
static updateSite<T>(title_id: string, site_id: string, data: Partial<CreateHostingSiteRequest> & Record<string, any>): AxiosPromise<Response<T>>;
|
|
11562
|
+
static createUploadUrl<T>(title_id: string, site_id: string): AxiosPromise<Response<T>>;
|
|
11563
|
+
/** Upload directly to the short-lived Azure URL returned by createUploadUrl. */
|
|
11564
|
+
static uploadBuild(uploadUrl: string, file: Blob, requiredHeaders?: Record<string, string>, onUploadProgress?: (event: AxiosProgressEvent) => void): AxiosPromise<void>;
|
|
11565
|
+
static releases<T>(title_id: string, site_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
11566
|
+
static createRelease<T>(title_id: string, site_id: string, data: CreateHostingReleaseRequest): AxiosPromise<Response<T>>;
|
|
11567
|
+
static promoteRelease<T>(title_id: string, site_id: string, release_id: string): AxiosPromise<Response<T>>;
|
|
11568
|
+
static connectDomain<T>(title_id: string, site_id: string, hostname: string): AxiosPromise<Response<T>>;
|
|
11569
|
+
static verifyDomain<T>(title_id: string, site_id: string, domain_id: string): AxiosPromise<Response<T>>;
|
|
11570
|
+
static checkDomain<T>(hostname: string): AxiosPromise<Response<T>>;
|
|
11571
|
+
static purchaseDomain<T>(title_id: string, site_id: string, data: Record<string, any>): AxiosPromise<Response<T>>;
|
|
11572
|
+
static aiInstructions<T>(title_id: string, site_id: string, data?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
11573
|
+
static resolve<T>(hostname: string): AxiosPromise<Response<T>>;
|
|
11574
|
+
static startPlaySession<T>(data: Record<string, any>): AxiosPromise<Response<T>>;
|
|
11575
|
+
static heartbeatPlaySession<T>(session_id: string, sessionToken: string): AxiosPromise<Response<T>>;
|
|
11576
|
+
static databases<T>(title_id: string, site_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
11577
|
+
static createDatabase<T>(title_id: string, site_id: string, data: CreateHostingDatabaseRequest): AxiosPromise<Response<T>>;
|
|
11578
|
+
static database<T>(title_id: string, site_id: string, database_id: string): AxiosPromise<Response<T>>;
|
|
11579
|
+
static updateDatabase<T>(title_id: string, site_id: string, database_id: string, data: Record<string, any>): AxiosPromise<Response<T>>;
|
|
11580
|
+
static retryDatabase<T>(title_id: string, site_id: string, database_id: string): AxiosPromise<Response<T>>;
|
|
11581
|
+
static deleteDatabase<T>(title_id: string, site_id: string, database_id: string, confirmation: string): AxiosPromise<Response<T>>;
|
|
11582
|
+
}
|
|
11583
|
+
|
|
11528
11584
|
interface Route {
|
|
11529
11585
|
url: string;
|
|
11530
11586
|
method: string;
|
|
@@ -11896,6 +11952,7 @@ declare class Glitch {
|
|
|
11896
11952
|
AdminUsers: typeof AdminUsers;
|
|
11897
11953
|
MarketResearch: typeof MarketResearch;
|
|
11898
11954
|
GameAdvertising: typeof GameAdvertising;
|
|
11955
|
+
Hosting: typeof Hosting;
|
|
11899
11956
|
};
|
|
11900
11957
|
static util: {
|
|
11901
11958
|
Requests: typeof Requests;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glitch-javascript-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "Javascript SDK for Glitch",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"types": "dist/index.d.ts",
|
|
15
15
|
"scripts": {
|
|
16
|
-
"test": "node scripts/test-game-advertising-routes.cjs && node scripts/test-discord-media-routes.cjs && node scripts/test-user-email-delivery-routes.cjs && node scripts/test-game-show-ticket-routes.cjs",
|
|
16
|
+
"test": "node scripts/test-hosting-routes.cjs && node scripts/test-game-advertising-routes.cjs && node scripts/test-discord-media-routes.cjs && node scripts/test-user-email-delivery-routes.cjs && node scripts/test-game-show-ticket-routes.cjs",
|
|
17
17
|
"build": "rm -Rf dist && rollup -c --bundleConfigAsCjs",
|
|
18
18
|
"build-docs": "rm -rf docs && typedoc --tsconfig tsconfig.json src/"
|
|
19
19
|
},
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import axios, { AxiosPromise, AxiosProgressEvent } from 'axios';
|
|
2
|
+
import HostingRoute from '../routes/HostingRoute';
|
|
3
|
+
import Config from '../config/Config';
|
|
4
|
+
import Requests from '../util/Requests';
|
|
5
|
+
import Response from '../util/Response';
|
|
6
|
+
|
|
7
|
+
export type HostingPlanKey = 'free' | 'launch' | 'growth' | 'scale' | 'studio';
|
|
8
|
+
export type HostingMode = 'static' | 'server';
|
|
9
|
+
export type HostingDatabaseEngine = 'postgresql' | 'mysql' | 'azure_sql' | 'cosmos_nosql';
|
|
10
|
+
export type HostingDatabasePlan = 'sandbox' | 'launch' | 'growth' | 'scale' | 'dedicated';
|
|
11
|
+
export type HostingDeliveryChannel = 'glitch_store' | 'glitch_hosted_subdomain' | 'glitch_hosted_custom_domain' | 'external';
|
|
12
|
+
|
|
13
|
+
export interface HostingAccount {
|
|
14
|
+
id: string;
|
|
15
|
+
community_id: string;
|
|
16
|
+
plan: HostingPlanKey;
|
|
17
|
+
status: string;
|
|
18
|
+
included_bandwidth_bytes: number;
|
|
19
|
+
used_bandwidth_bytes: number;
|
|
20
|
+
remaining_bandwidth_bytes: number;
|
|
21
|
+
bandwidth_overage_enabled: boolean;
|
|
22
|
+
bandwidth_spend_limit_cents?: number | null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface HostingRelease {
|
|
26
|
+
id: string;
|
|
27
|
+
hosting_site_id: string;
|
|
28
|
+
game_build_id?: string | null;
|
|
29
|
+
version: string;
|
|
30
|
+
status: 'uploading' | 'processing' | 'ready' | 'failed' | 'active' | 'inactive';
|
|
31
|
+
source_type: 'upload' | 'cli' | 'game_build';
|
|
32
|
+
entry_point: string;
|
|
33
|
+
size_bytes: number;
|
|
34
|
+
checksum?: string | null;
|
|
35
|
+
error_message?: string | null;
|
|
36
|
+
promoted_at?: string | null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface HostingDomain {
|
|
40
|
+
id: string;
|
|
41
|
+
hostname: string;
|
|
42
|
+
type: 'generated' | 'custom' | 'managed';
|
|
43
|
+
status: 'pending_verification' | 'provisioning' | 'active' | 'failed' | 'expired';
|
|
44
|
+
verification_record_type?: string | null;
|
|
45
|
+
verification_record_name?: string | null;
|
|
46
|
+
verification_record_value?: string | null;
|
|
47
|
+
certificate_status?: string | null;
|
|
48
|
+
annual_price_cents?: number | null;
|
|
49
|
+
auto_renew: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface HostingDatabase {
|
|
53
|
+
id: string;
|
|
54
|
+
hosting_site_id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
engine: HostingDatabaseEngine;
|
|
57
|
+
plan: HostingDatabasePlan;
|
|
58
|
+
status: 'awaiting_payment' | 'requested' | 'provisioning' | 'ready' | 'resizing' | 'restoring' | 'failed' | 'deleting' | 'deleted';
|
|
59
|
+
deployment_model: 'shared' | 'dedicated' | 'serverless';
|
|
60
|
+
azure_region: string;
|
|
61
|
+
included_storage_bytes: number;
|
|
62
|
+
current_storage_bytes: number;
|
|
63
|
+
auto_grow_enabled: boolean;
|
|
64
|
+
backup_retention_days: number;
|
|
65
|
+
high_availability_enabled: boolean;
|
|
66
|
+
endpoint?: string | null;
|
|
67
|
+
port?: number | null;
|
|
68
|
+
binding_name: 'DATABASE_URL' | 'COSMOS_DATABASE';
|
|
69
|
+
last_error?: string | null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface HostingSite {
|
|
73
|
+
id: string;
|
|
74
|
+
hosting_account_id: string;
|
|
75
|
+
community_id: string;
|
|
76
|
+
title_id: string;
|
|
77
|
+
name: string;
|
|
78
|
+
slug: string;
|
|
79
|
+
community_slug: string;
|
|
80
|
+
generated_hostname: string;
|
|
81
|
+
url: string;
|
|
82
|
+
mode: HostingMode;
|
|
83
|
+
status: 'draft' | 'provisioning' | 'live' | 'limited' | 'failed' | 'disabled';
|
|
84
|
+
server_mode_enabled: boolean;
|
|
85
|
+
azure_region?: string | null;
|
|
86
|
+
active_release?: HostingRelease | null;
|
|
87
|
+
domains?: HostingDomain[];
|
|
88
|
+
databases?: HostingDatabase[];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface CreateHostingSiteRequest {
|
|
92
|
+
name: string;
|
|
93
|
+
slug: string;
|
|
94
|
+
mode: HostingMode;
|
|
95
|
+
azure_region?: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface CreateHostingReleaseRequest {
|
|
99
|
+
version: string;
|
|
100
|
+
source_type: 'upload' | 'cli' | 'game_build';
|
|
101
|
+
blob_path?: string;
|
|
102
|
+
game_build_id?: string;
|
|
103
|
+
entry_point?: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface CreateHostingDatabaseRequest {
|
|
107
|
+
name: string;
|
|
108
|
+
engine: HostingDatabaseEngine;
|
|
109
|
+
plan: HostingDatabasePlan;
|
|
110
|
+
azure_region: string;
|
|
111
|
+
auto_grow_enabled?: boolean;
|
|
112
|
+
high_availability_enabled?: boolean;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Typed SDK for game website hosting, Azure database add-ons, domains, usage,
|
|
117
|
+
* deployment instructions, and hosted-play attribution.
|
|
118
|
+
*/
|
|
119
|
+
class Hosting {
|
|
120
|
+
public static catalog<T>(): AxiosPromise<Response<T>> {
|
|
121
|
+
return Requests.processRoute(HostingRoute.routes.catalog);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
public static dashboard<T>(title_id: string): AxiosPromise<Response<T>> {
|
|
125
|
+
return Requests.processRoute(HostingRoute.routes.dashboard, undefined, { title_id });
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
public static channelAnalytics<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
129
|
+
return Requests.processRoute(HostingRoute.routes.channelAnalytics, undefined, { title_id }, params);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
public static createSite<T>(title_id: string, data: CreateHostingSiteRequest): AxiosPromise<Response<T>> {
|
|
133
|
+
return Requests.processRoute(HostingRoute.routes.createSite, data, { title_id });
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
public static updateSite<T>(title_id: string, site_id: string, data: Partial<CreateHostingSiteRequest> & Record<string, any>): AxiosPromise<Response<T>> {
|
|
137
|
+
return Requests.processRoute(HostingRoute.routes.updateSite, data, { title_id, site_id });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
public static createUploadUrl<T>(title_id: string, site_id: string): AxiosPromise<Response<T>> {
|
|
141
|
+
return Requests.processRoute(HostingRoute.routes.uploadUrl, {}, { title_id, site_id });
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** Upload directly to the short-lived Azure URL returned by createUploadUrl. */
|
|
145
|
+
public static uploadBuild(uploadUrl: string, file: Blob, requiredHeaders: Record<string, string> = {}, onUploadProgress?: (event: AxiosProgressEvent) => void): AxiosPromise<void> {
|
|
146
|
+
return axios.put(uploadUrl, file, {
|
|
147
|
+
headers: { 'x-ms-blob-type': 'BlockBlob', 'Content-Type': 'application/zip', ...requiredHeaders },
|
|
148
|
+
onUploadProgress,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
public static releases<T>(title_id: string, site_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
153
|
+
return Requests.processRoute(HostingRoute.routes.releases, undefined, { title_id, site_id }, params);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
public static createRelease<T>(title_id: string, site_id: string, data: CreateHostingReleaseRequest): AxiosPromise<Response<T>> {
|
|
157
|
+
return Requests.processRoute(HostingRoute.routes.createRelease, data, { title_id, site_id });
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
public static promoteRelease<T>(title_id: string, site_id: string, release_id: string): AxiosPromise<Response<T>> {
|
|
161
|
+
return Requests.processRoute(HostingRoute.routes.promoteRelease, {}, { title_id, site_id, release_id });
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
public static connectDomain<T>(title_id: string, site_id: string, hostname: string): AxiosPromise<Response<T>> {
|
|
165
|
+
return Requests.processRoute(HostingRoute.routes.connectDomain, { hostname }, { title_id, site_id });
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
public static verifyDomain<T>(title_id: string, site_id: string, domain_id: string): AxiosPromise<Response<T>> {
|
|
169
|
+
return Requests.processRoute(HostingRoute.routes.verifyDomain, {}, { title_id, site_id, domain_id });
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
public static checkDomain<T>(hostname: string): AxiosPromise<Response<T>> {
|
|
173
|
+
return Requests.processRoute(HostingRoute.routes.checkDomain, { hostname });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
public static purchaseDomain<T>(title_id: string, site_id: string, data: Record<string, any>): AxiosPromise<Response<T>> {
|
|
177
|
+
return Requests.processRoute(HostingRoute.routes.purchaseDomain, data, { title_id, site_id });
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
public static aiInstructions<T>(title_id: string, site_id: string, data: Record<string, any> = {}): AxiosPromise<Response<T>> {
|
|
181
|
+
return Requests.processRoute(HostingRoute.routes.aiInstructions, data, { title_id, site_id });
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
public static resolve<T>(hostname: string): AxiosPromise<Response<T>> {
|
|
185
|
+
return Requests.processRoute(HostingRoute.routes.resolve, undefined, undefined, { hostname });
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
public static startPlaySession<T>(data: Record<string, any>): AxiosPromise<Response<T>> {
|
|
189
|
+
return Requests.processRoute(HostingRoute.routes.startPlaySession, data);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
public static heartbeatPlaySession<T>(session_id: string, sessionToken: string): AxiosPromise<Response<T>> {
|
|
193
|
+
const path = HostingRoute.routes.heartbeatPlaySession.url.replace('{session_id}', session_id);
|
|
194
|
+
const base = (Config.getBaseUrl() || '').replace(/\/+$/, '');
|
|
195
|
+
return axios.post(`${base}/${path.replace(/^\/+/, '')}`, {}, { headers: { Authorization: `Bearer ${sessionToken}` } });
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
public static databases<T>(title_id: string, site_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
199
|
+
return Requests.processRoute(HostingRoute.routes.databases, undefined, { title_id, site_id }, params);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
public static createDatabase<T>(title_id: string, site_id: string, data: CreateHostingDatabaseRequest): AxiosPromise<Response<T>> {
|
|
203
|
+
return Requests.processRoute(HostingRoute.routes.createDatabase, data, { title_id, site_id });
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
public static database<T>(title_id: string, site_id: string, database_id: string): AxiosPromise<Response<T>> {
|
|
207
|
+
return Requests.processRoute(HostingRoute.routes.database, undefined, { title_id, site_id, database_id });
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
public static updateDatabase<T>(title_id: string, site_id: string, database_id: string, data: Record<string, any>): AxiosPromise<Response<T>> {
|
|
211
|
+
return Requests.processRoute(HostingRoute.routes.updateDatabase, data, { title_id, site_id, database_id });
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
public static retryDatabase<T>(title_id: string, site_id: string, database_id: string): AxiosPromise<Response<T>> {
|
|
215
|
+
return Requests.processRoute(HostingRoute.routes.retryDatabase, {}, { title_id, site_id, database_id });
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
public static deleteDatabase<T>(title_id: string, site_id: string, database_id: string, confirmation: string): AxiosPromise<Response<T>> {
|
|
219
|
+
return Requests.processRoute(HostingRoute.routes.deleteDatabase, undefined, { title_id, site_id, database_id }, { confirmation });
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export default Hosting;
|
package/src/api/index.ts
CHANGED
|
@@ -52,6 +52,7 @@ import AdminReports from "./AdminReports";
|
|
|
52
52
|
import AdminUsers from "./AdminUsers";
|
|
53
53
|
import MarketResearch from "./MarketResearch";
|
|
54
54
|
import GameAdvertising from './GameAdvertising';
|
|
55
|
+
import Hosting from './Hosting';
|
|
55
56
|
|
|
56
57
|
export {Ads};
|
|
57
58
|
export {AccessKeys};
|
|
@@ -107,3 +108,4 @@ export {AdminReports};
|
|
|
107
108
|
export {AdminUsers};
|
|
108
109
|
export {MarketResearch};
|
|
109
110
|
export {GameAdvertising};
|
|
111
|
+
export {Hosting};
|
package/src/index.ts
CHANGED
|
@@ -56,6 +56,7 @@ import {AdminReports} from './api';
|
|
|
56
56
|
import {AdminUsers} from './api';
|
|
57
57
|
import {MarketResearch} from './api';
|
|
58
58
|
import {GameAdvertising} from './api';
|
|
59
|
+
import {Hosting} from './api';
|
|
59
60
|
|
|
60
61
|
import Requests from "./util/Requests";
|
|
61
62
|
import Parser from "./util/Parser";
|
|
@@ -141,6 +142,7 @@ class Glitch {
|
|
|
141
142
|
AdminUsers : AdminUsers,
|
|
142
143
|
MarketResearch : MarketResearch,
|
|
143
144
|
GameAdvertising: GameAdvertising,
|
|
145
|
+
Hosting: Hosting,
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
public static util = {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Route from './interface';
|
|
2
|
+
import HTTP_METHODS from '../constants/HttpMethods';
|
|
3
|
+
|
|
4
|
+
/** Route catalog for Azure-backed game website hosting. */
|
|
5
|
+
class HostingRoute {
|
|
6
|
+
public static routes: { [key: string]: Route } = {
|
|
7
|
+
catalog: { url: '/hosting/catalog', method: HTTP_METHODS.GET },
|
|
8
|
+
dashboard: { url: '/titles/{title_id}/hosting', method: HTTP_METHODS.GET },
|
|
9
|
+
channelAnalytics: { url: '/titles/{title_id}/hosting/analytics/channels', method: HTTP_METHODS.GET },
|
|
10
|
+
createSite: { url: '/titles/{title_id}/hosting/sites', method: HTTP_METHODS.POST },
|
|
11
|
+
updateSite: { url: '/titles/{title_id}/hosting/sites/{site_id}', method: HTTP_METHODS.PUT },
|
|
12
|
+
uploadUrl: { url: '/titles/{title_id}/hosting/sites/{site_id}/upload-url', method: HTTP_METHODS.POST },
|
|
13
|
+
releases: { url: '/titles/{title_id}/hosting/sites/{site_id}/releases', method: HTTP_METHODS.GET },
|
|
14
|
+
createRelease: { url: '/titles/{title_id}/hosting/sites/{site_id}/releases', method: HTTP_METHODS.POST },
|
|
15
|
+
promoteRelease: { url: '/titles/{title_id}/hosting/sites/{site_id}/releases/{release_id}/promote', method: HTTP_METHODS.POST },
|
|
16
|
+
connectDomain: { url: '/titles/{title_id}/hosting/sites/{site_id}/domains', method: HTTP_METHODS.POST },
|
|
17
|
+
verifyDomain: { url: '/titles/{title_id}/hosting/sites/{site_id}/domains/{domain_id}/verify', method: HTTP_METHODS.POST },
|
|
18
|
+
checkDomain: { url: '/hosting/domains/check', method: HTTP_METHODS.POST },
|
|
19
|
+
purchaseDomain: { url: '/titles/{title_id}/hosting/sites/{site_id}/domains/purchase', method: HTTP_METHODS.POST },
|
|
20
|
+
aiInstructions: { url: '/titles/{title_id}/hosting/sites/{site_id}/ai-instructions', method: HTTP_METHODS.POST },
|
|
21
|
+
resolve: { url: '/hosting/resolve', method: HTTP_METHODS.GET },
|
|
22
|
+
startPlaySession: { url: '/hosting/play-sessions', method: HTTP_METHODS.POST },
|
|
23
|
+
heartbeatPlaySession: { url: '/hosting/play-sessions/{session_id}/heartbeat', method: HTTP_METHODS.POST },
|
|
24
|
+
databases: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases', method: HTTP_METHODS.GET },
|
|
25
|
+
createDatabase: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases', method: HTTP_METHODS.POST },
|
|
26
|
+
database: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}', method: HTTP_METHODS.GET },
|
|
27
|
+
updateDatabase: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}', method: HTTP_METHODS.PUT },
|
|
28
|
+
retryDatabase: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}/retry', method: HTTP_METHODS.POST },
|
|
29
|
+
deleteDatabase: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}', method: HTTP_METHODS.DELETE },
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default HostingRoute;
|