glitch-javascript-sdk 3.8.14 → 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 +115 -0
- 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/cjs/index.js
CHANGED
|
@@ -33349,6 +33349,128 @@ var GameAdvertising = /** @class */ (function () {
|
|
|
33349
33349
|
return GameAdvertising;
|
|
33350
33350
|
}());
|
|
33351
33351
|
|
|
33352
|
+
/** Route catalog for Azure-backed game website hosting. */
|
|
33353
|
+
var HostingRoute = /** @class */ (function () {
|
|
33354
|
+
function HostingRoute() {
|
|
33355
|
+
}
|
|
33356
|
+
HostingRoute.routes = {
|
|
33357
|
+
catalog: { url: '/hosting/catalog', method: HTTP_METHODS.GET },
|
|
33358
|
+
dashboard: { url: '/titles/{title_id}/hosting', method: HTTP_METHODS.GET },
|
|
33359
|
+
channelAnalytics: { url: '/titles/{title_id}/hosting/analytics/channels', method: HTTP_METHODS.GET },
|
|
33360
|
+
createSite: { url: '/titles/{title_id}/hosting/sites', method: HTTP_METHODS.POST },
|
|
33361
|
+
updateSite: { url: '/titles/{title_id}/hosting/sites/{site_id}', method: HTTP_METHODS.PUT },
|
|
33362
|
+
uploadUrl: { url: '/titles/{title_id}/hosting/sites/{site_id}/upload-url', method: HTTP_METHODS.POST },
|
|
33363
|
+
releases: { url: '/titles/{title_id}/hosting/sites/{site_id}/releases', method: HTTP_METHODS.GET },
|
|
33364
|
+
createRelease: { url: '/titles/{title_id}/hosting/sites/{site_id}/releases', method: HTTP_METHODS.POST },
|
|
33365
|
+
promoteRelease: { url: '/titles/{title_id}/hosting/sites/{site_id}/releases/{release_id}/promote', method: HTTP_METHODS.POST },
|
|
33366
|
+
connectDomain: { url: '/titles/{title_id}/hosting/sites/{site_id}/domains', method: HTTP_METHODS.POST },
|
|
33367
|
+
verifyDomain: { url: '/titles/{title_id}/hosting/sites/{site_id}/domains/{domain_id}/verify', method: HTTP_METHODS.POST },
|
|
33368
|
+
checkDomain: { url: '/hosting/domains/check', method: HTTP_METHODS.POST },
|
|
33369
|
+
purchaseDomain: { url: '/titles/{title_id}/hosting/sites/{site_id}/domains/purchase', method: HTTP_METHODS.POST },
|
|
33370
|
+
aiInstructions: { url: '/titles/{title_id}/hosting/sites/{site_id}/ai-instructions', method: HTTP_METHODS.POST },
|
|
33371
|
+
resolve: { url: '/hosting/resolve', method: HTTP_METHODS.GET },
|
|
33372
|
+
startPlaySession: { url: '/hosting/play-sessions', method: HTTP_METHODS.POST },
|
|
33373
|
+
heartbeatPlaySession: { url: '/hosting/play-sessions/{session_id}/heartbeat', method: HTTP_METHODS.POST },
|
|
33374
|
+
databases: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases', method: HTTP_METHODS.GET },
|
|
33375
|
+
createDatabase: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases', method: HTTP_METHODS.POST },
|
|
33376
|
+
database: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}', method: HTTP_METHODS.GET },
|
|
33377
|
+
updateDatabase: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}', method: HTTP_METHODS.PUT },
|
|
33378
|
+
retryDatabase: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}/retry', method: HTTP_METHODS.POST },
|
|
33379
|
+
deleteDatabase: { url: '/titles/{title_id}/hosting/sites/{site_id}/databases/{database_id}', method: HTTP_METHODS.DELETE },
|
|
33380
|
+
};
|
|
33381
|
+
return HostingRoute;
|
|
33382
|
+
}());
|
|
33383
|
+
|
|
33384
|
+
/**
|
|
33385
|
+
* Typed SDK for game website hosting, Azure database add-ons, domains, usage,
|
|
33386
|
+
* deployment instructions, and hosted-play attribution.
|
|
33387
|
+
*/
|
|
33388
|
+
var Hosting = /** @class */ (function () {
|
|
33389
|
+
function Hosting() {
|
|
33390
|
+
}
|
|
33391
|
+
Hosting.catalog = function () {
|
|
33392
|
+
return Requests.processRoute(HostingRoute.routes.catalog);
|
|
33393
|
+
};
|
|
33394
|
+
Hosting.dashboard = function (title_id) {
|
|
33395
|
+
return Requests.processRoute(HostingRoute.routes.dashboard, undefined, { title_id: title_id });
|
|
33396
|
+
};
|
|
33397
|
+
Hosting.channelAnalytics = function (title_id, params) {
|
|
33398
|
+
return Requests.processRoute(HostingRoute.routes.channelAnalytics, undefined, { title_id: title_id }, params);
|
|
33399
|
+
};
|
|
33400
|
+
Hosting.createSite = function (title_id, data) {
|
|
33401
|
+
return Requests.processRoute(HostingRoute.routes.createSite, data, { title_id: title_id });
|
|
33402
|
+
};
|
|
33403
|
+
Hosting.updateSite = function (title_id, site_id, data) {
|
|
33404
|
+
return Requests.processRoute(HostingRoute.routes.updateSite, data, { title_id: title_id, site_id: site_id });
|
|
33405
|
+
};
|
|
33406
|
+
Hosting.createUploadUrl = function (title_id, site_id) {
|
|
33407
|
+
return Requests.processRoute(HostingRoute.routes.uploadUrl, {}, { title_id: title_id, site_id: site_id });
|
|
33408
|
+
};
|
|
33409
|
+
/** Upload directly to the short-lived Azure URL returned by createUploadUrl. */
|
|
33410
|
+
Hosting.uploadBuild = function (uploadUrl, file, requiredHeaders, onUploadProgress) {
|
|
33411
|
+
if (requiredHeaders === void 0) { requiredHeaders = {}; }
|
|
33412
|
+
return axios$1.put(uploadUrl, file, {
|
|
33413
|
+
headers: __assign({ 'x-ms-blob-type': 'BlockBlob', 'Content-Type': 'application/zip' }, requiredHeaders),
|
|
33414
|
+
onUploadProgress: onUploadProgress,
|
|
33415
|
+
});
|
|
33416
|
+
};
|
|
33417
|
+
Hosting.releases = function (title_id, site_id, params) {
|
|
33418
|
+
return Requests.processRoute(HostingRoute.routes.releases, undefined, { title_id: title_id, site_id: site_id }, params);
|
|
33419
|
+
};
|
|
33420
|
+
Hosting.createRelease = function (title_id, site_id, data) {
|
|
33421
|
+
return Requests.processRoute(HostingRoute.routes.createRelease, data, { title_id: title_id, site_id: site_id });
|
|
33422
|
+
};
|
|
33423
|
+
Hosting.promoteRelease = function (title_id, site_id, release_id) {
|
|
33424
|
+
return Requests.processRoute(HostingRoute.routes.promoteRelease, {}, { title_id: title_id, site_id: site_id, release_id: release_id });
|
|
33425
|
+
};
|
|
33426
|
+
Hosting.connectDomain = function (title_id, site_id, hostname) {
|
|
33427
|
+
return Requests.processRoute(HostingRoute.routes.connectDomain, { hostname: hostname }, { title_id: title_id, site_id: site_id });
|
|
33428
|
+
};
|
|
33429
|
+
Hosting.verifyDomain = function (title_id, site_id, domain_id) {
|
|
33430
|
+
return Requests.processRoute(HostingRoute.routes.verifyDomain, {}, { title_id: title_id, site_id: site_id, domain_id: domain_id });
|
|
33431
|
+
};
|
|
33432
|
+
Hosting.checkDomain = function (hostname) {
|
|
33433
|
+
return Requests.processRoute(HostingRoute.routes.checkDomain, { hostname: hostname });
|
|
33434
|
+
};
|
|
33435
|
+
Hosting.purchaseDomain = function (title_id, site_id, data) {
|
|
33436
|
+
return Requests.processRoute(HostingRoute.routes.purchaseDomain, data, { title_id: title_id, site_id: site_id });
|
|
33437
|
+
};
|
|
33438
|
+
Hosting.aiInstructions = function (title_id, site_id, data) {
|
|
33439
|
+
if (data === void 0) { data = {}; }
|
|
33440
|
+
return Requests.processRoute(HostingRoute.routes.aiInstructions, data, { title_id: title_id, site_id: site_id });
|
|
33441
|
+
};
|
|
33442
|
+
Hosting.resolve = function (hostname) {
|
|
33443
|
+
return Requests.processRoute(HostingRoute.routes.resolve, undefined, undefined, { hostname: hostname });
|
|
33444
|
+
};
|
|
33445
|
+
Hosting.startPlaySession = function (data) {
|
|
33446
|
+
return Requests.processRoute(HostingRoute.routes.startPlaySession, data);
|
|
33447
|
+
};
|
|
33448
|
+
Hosting.heartbeatPlaySession = function (session_id, sessionToken) {
|
|
33449
|
+
var path = HostingRoute.routes.heartbeatPlaySession.url.replace('{session_id}', session_id);
|
|
33450
|
+
var base = (Config.getBaseUrl() || '').replace(/\/+$/, '');
|
|
33451
|
+
return axios$1.post("".concat(base, "/").concat(path.replace(/^\/+/, '')), {}, { headers: { Authorization: "Bearer ".concat(sessionToken) } });
|
|
33452
|
+
};
|
|
33453
|
+
Hosting.databases = function (title_id, site_id, params) {
|
|
33454
|
+
return Requests.processRoute(HostingRoute.routes.databases, undefined, { title_id: title_id, site_id: site_id }, params);
|
|
33455
|
+
};
|
|
33456
|
+
Hosting.createDatabase = function (title_id, site_id, data) {
|
|
33457
|
+
return Requests.processRoute(HostingRoute.routes.createDatabase, data, { title_id: title_id, site_id: site_id });
|
|
33458
|
+
};
|
|
33459
|
+
Hosting.database = function (title_id, site_id, database_id) {
|
|
33460
|
+
return Requests.processRoute(HostingRoute.routes.database, undefined, { title_id: title_id, site_id: site_id, database_id: database_id });
|
|
33461
|
+
};
|
|
33462
|
+
Hosting.updateDatabase = function (title_id, site_id, database_id, data) {
|
|
33463
|
+
return Requests.processRoute(HostingRoute.routes.updateDatabase, data, { title_id: title_id, site_id: site_id, database_id: database_id });
|
|
33464
|
+
};
|
|
33465
|
+
Hosting.retryDatabase = function (title_id, site_id, database_id) {
|
|
33466
|
+
return Requests.processRoute(HostingRoute.routes.retryDatabase, {}, { title_id: title_id, site_id: site_id, database_id: database_id });
|
|
33467
|
+
};
|
|
33468
|
+
Hosting.deleteDatabase = function (title_id, site_id, database_id, confirmation) {
|
|
33469
|
+
return Requests.processRoute(HostingRoute.routes.deleteDatabase, undefined, { title_id: title_id, site_id: site_id, database_id: database_id }, { confirmation: confirmation });
|
|
33470
|
+
};
|
|
33471
|
+
return Hosting;
|
|
33472
|
+
}());
|
|
33473
|
+
|
|
33352
33474
|
var Parser = /** @class */ (function () {
|
|
33353
33475
|
function Parser() {
|
|
33354
33476
|
}
|
|
@@ -33899,6 +34021,7 @@ var Glitch = /** @class */ (function () {
|
|
|
33899
34021
|
AdminUsers: AdminUsers,
|
|
33900
34022
|
MarketResearch: MarketResearch,
|
|
33901
34023
|
GameAdvertising: GameAdvertising,
|
|
34024
|
+
Hosting: Hosting,
|
|
33902
34025
|
};
|
|
33903
34026
|
Glitch.util = {
|
|
33904
34027
|
Requests: Requests,
|