glitch-javascript-sdk 2.9.4 → 2.9.5
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 +84 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Titles.d.ts +21 -0
- package/dist/esm/api/Users.d.ts +20 -0
- package/dist/esm/index.js +84 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +41 -0
- package/package.json +1 -1
- package/src/api/Titles.ts +62 -0
- package/src/api/Users.ts +21 -0
- package/src/routes/TitlesRoute.ts +20 -0
- package/src/routes/UserRoutes.ts +5 -0
package/dist/esm/api/Titles.d.ts
CHANGED
|
@@ -613,5 +613,26 @@ declare class Titles {
|
|
|
613
613
|
* Stitch together all uploaded chunks to complete the file in S3.
|
|
614
614
|
*/
|
|
615
615
|
static completeMultipartUpload<T>(title_id: string, data: object): AxiosPromise<Response<T>>;
|
|
616
|
+
static listProgressionStats<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
617
|
+
static createProgressionStat<T>(title_id: string, data: object): AxiosPromise<Response<T>>;
|
|
618
|
+
static deleteProgressionStat<T>(title_id: string, id: string): AxiosPromise<Response<T>>;
|
|
619
|
+
static listProgressionAchievements<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
620
|
+
static createProgressionAchievement<T>(title_id: string, data: object): AxiosPromise<Response<T>>;
|
|
621
|
+
static listProgressionLeaderboards<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
622
|
+
static createProgressionLeaderboard<T>(title_id: string, data: object): AxiosPromise<Response<T>>;
|
|
623
|
+
static listProgressionSeasons<T>(title_id: string): AxiosPromise<Response<T>>;
|
|
624
|
+
static createProgressionSeason<T>(title_id: string, data: object): AxiosPromise<Response<T>>;
|
|
625
|
+
/**
|
|
626
|
+
* Submit a gameplay run. Updates stats and scores using the install_id for privacy.
|
|
627
|
+
* @param data { idempotency_key: string, payload: { stats: {}, scores: {} } }
|
|
628
|
+
*/
|
|
629
|
+
static submitProgressionRun<T>(title_id: string, install_id: string, data: object): AxiosPromise<Response<T>>;
|
|
630
|
+
static getProgressionPlayerStats<T>(title_id: string, install_id: string): AxiosPromise<Response<T>>;
|
|
631
|
+
static getProgressionPlayerAchievements<T>(title_id: string, install_id: string): AxiosPromise<Response<T>>;
|
|
632
|
+
/**
|
|
633
|
+
* View leaderboard rankings.
|
|
634
|
+
* @param params Optional filters like { around_me: true, install_id: 'uuid', season_id: 'uuid' }
|
|
635
|
+
*/
|
|
636
|
+
static getProgressionLeaderboard<T>(title_id: string, api_key: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
616
637
|
}
|
|
617
638
|
export default Titles;
|
package/dist/esm/api/Users.d.ts
CHANGED
|
@@ -396,5 +396,25 @@ declare class Users {
|
|
|
396
396
|
* Includes playtime and last played timestamps.
|
|
397
397
|
*/
|
|
398
398
|
static playedGames<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
399
|
+
/**
|
|
400
|
+
* Get all stats for a user, optionally filtered by title_id.
|
|
401
|
+
*/
|
|
402
|
+
static getProgressionStats<T>(user_id: string, params?: {
|
|
403
|
+
title_id?: string;
|
|
404
|
+
}): AxiosPromise<Response<T>>;
|
|
405
|
+
/**
|
|
406
|
+
* Get all achievements for a user.
|
|
407
|
+
*/
|
|
408
|
+
static getProgressionAchievements<T>(user_id: string, params?: {
|
|
409
|
+
title_id?: string;
|
|
410
|
+
status?: string;
|
|
411
|
+
}): AxiosPromise<Response<T>>;
|
|
412
|
+
/**
|
|
413
|
+
* Get the raw gameplay history (Run Records) for a user.
|
|
414
|
+
*/
|
|
415
|
+
static getProgressionHistory<T>(user_id: string, params?: {
|
|
416
|
+
title_id?: string;
|
|
417
|
+
page?: number;
|
|
418
|
+
}): AxiosPromise<Response<T>>;
|
|
399
419
|
}
|
|
400
420
|
export default Users;
|
package/dist/esm/index.js
CHANGED
|
@@ -8802,6 +8802,9 @@ var UserRoutes = /** @class */ (function () {
|
|
|
8802
8802
|
clearInstagramAuth: { url: '/users/clearInstagramAuth', method: HTTP_METHODS.DELETE },
|
|
8803
8803
|
getSubredditRules: { url: "/users/reddit/redditrules/{subreddit}", method: HTTP_METHODS.GET },
|
|
8804
8804
|
playedGames: { url: '/users/me/played-games', method: HTTP_METHODS.GET },
|
|
8805
|
+
userProgressionStats: { url: '/users/{user_id}/progression/stats', method: HTTP_METHODS.GET },
|
|
8806
|
+
userProgressionAchievements: { url: '/users/{user_id}/progression/achievements', method: HTTP_METHODS.GET },
|
|
8807
|
+
userProgressionHistory: { url: '/users/{user_id}/progression/history', method: HTTP_METHODS.GET },
|
|
8805
8808
|
};
|
|
8806
8809
|
return UserRoutes;
|
|
8807
8810
|
}());
|
|
@@ -9292,6 +9295,24 @@ var Users = /** @class */ (function () {
|
|
|
9292
9295
|
Users.playedGames = function (params) {
|
|
9293
9296
|
return Requests.processRoute(UserRoutes.routes.playedGames, undefined, undefined, params);
|
|
9294
9297
|
};
|
|
9298
|
+
/**
|
|
9299
|
+
* Get all stats for a user, optionally filtered by title_id.
|
|
9300
|
+
*/
|
|
9301
|
+
Users.getProgressionStats = function (user_id, params) {
|
|
9302
|
+
return Requests.processRoute(UserRoutes.routes.userProgressionStats, undefined, { user_id: user_id }, params);
|
|
9303
|
+
};
|
|
9304
|
+
/**
|
|
9305
|
+
* Get all achievements for a user.
|
|
9306
|
+
*/
|
|
9307
|
+
Users.getProgressionAchievements = function (user_id, params) {
|
|
9308
|
+
return Requests.processRoute(UserRoutes.routes.userProgressionAchievements, undefined, { user_id: user_id }, params);
|
|
9309
|
+
};
|
|
9310
|
+
/**
|
|
9311
|
+
* Get the raw gameplay history (Run Records) for a user.
|
|
9312
|
+
*/
|
|
9313
|
+
Users.getProgressionHistory = function (user_id, params) {
|
|
9314
|
+
return Requests.processRoute(UserRoutes.routes.userProgressionHistory, undefined, { user_id: user_id }, params);
|
|
9315
|
+
};
|
|
9295
9316
|
return Users;
|
|
9296
9317
|
}());
|
|
9297
9318
|
|
|
@@ -11793,6 +11814,21 @@ var TitlesRoute = /** @class */ (function () {
|
|
|
11793
11814
|
url: '/titles/{title_id}/matchmaker/session/release',
|
|
11794
11815
|
method: HTTP_METHODS.POST
|
|
11795
11816
|
},
|
|
11817
|
+
// --- Title Progression Definitions (Developer API) ---
|
|
11818
|
+
progressionStatsList: { url: '/titles/{title_id}/progression/stats', method: HTTP_METHODS.GET },
|
|
11819
|
+
progressionStatsStore: { url: '/titles/{title_id}/progression/stats', method: HTTP_METHODS.POST },
|
|
11820
|
+
progressionStatsDelete: { url: '/titles/{title_id}/progression/stats/{id}', method: HTTP_METHODS.DELETE },
|
|
11821
|
+
progressionAchievementsList: { url: '/titles/{title_id}/progression/achievements', method: HTTP_METHODS.GET },
|
|
11822
|
+
progressionAchievementsStore: { url: '/titles/{title_id}/progression/achievements', method: HTTP_METHODS.POST },
|
|
11823
|
+
progressionLeaderboardsList: { url: '/titles/{title_id}/progression/leaderboards', method: HTTP_METHODS.GET },
|
|
11824
|
+
progressionLeaderboardsStore: { url: '/titles/{title_id}/progression/leaderboards', method: HTTP_METHODS.POST },
|
|
11825
|
+
progressionSeasonsList: { url: '/titles/{title_id}/progression/seasons', method: HTTP_METHODS.GET },
|
|
11826
|
+
progressionSeasonsStore: { url: '/titles/{title_id}/progression/seasons', method: HTTP_METHODS.POST },
|
|
11827
|
+
// --- In-Game Progression (Client API) ---
|
|
11828
|
+
progressionSubmit: { url: '/titles/{title_id}/installs/{install_id}/submit', method: HTTP_METHODS.POST },
|
|
11829
|
+
progressionPlayerStats: { url: '/titles/{title_id}/installs/{install_id}/stats', method: HTTP_METHODS.GET },
|
|
11830
|
+
progressionPlayerAchievements: { url: '/titles/{title_id}/installs/{install_id}/achievements', method: HTTP_METHODS.GET },
|
|
11831
|
+
progressionLeaderboardView: { url: '/titles/{title_id}/leaderboards/{api_key}', method: HTTP_METHODS.GET },
|
|
11796
11832
|
};
|
|
11797
11833
|
return TitlesRoute;
|
|
11798
11834
|
}());
|
|
@@ -12593,6 +12629,54 @@ var Titles = /** @class */ (function () {
|
|
|
12593
12629
|
Titles.completeMultipartUpload = function (title_id, data) {
|
|
12594
12630
|
return Requests.processRoute(TitlesRoute.routes.completeMultipartUpload, data, { title_id: title_id });
|
|
12595
12631
|
};
|
|
12632
|
+
// --- Developer Definition Methods ---
|
|
12633
|
+
Titles.listProgressionStats = function (title_id) {
|
|
12634
|
+
return Requests.processRoute(TitlesRoute.routes.progressionStatsList, undefined, { title_id: title_id });
|
|
12635
|
+
};
|
|
12636
|
+
Titles.createProgressionStat = function (title_id, data) {
|
|
12637
|
+
return Requests.processRoute(TitlesRoute.routes.progressionStatsStore, data, { title_id: title_id });
|
|
12638
|
+
};
|
|
12639
|
+
Titles.deleteProgressionStat = function (title_id, id) {
|
|
12640
|
+
return Requests.processRoute(TitlesRoute.routes.progressionStatsDelete, undefined, { title_id: title_id, id: id });
|
|
12641
|
+
};
|
|
12642
|
+
Titles.listProgressionAchievements = function (title_id) {
|
|
12643
|
+
return Requests.processRoute(TitlesRoute.routes.progressionAchievementsList, undefined, { title_id: title_id });
|
|
12644
|
+
};
|
|
12645
|
+
Titles.createProgressionAchievement = function (title_id, data) {
|
|
12646
|
+
return Requests.processRoute(TitlesRoute.routes.progressionAchievementsStore, data, { title_id: title_id });
|
|
12647
|
+
};
|
|
12648
|
+
Titles.listProgressionLeaderboards = function (title_id) {
|
|
12649
|
+
return Requests.processRoute(TitlesRoute.routes.progressionLeaderboardsList, undefined, { title_id: title_id });
|
|
12650
|
+
};
|
|
12651
|
+
Titles.createProgressionLeaderboard = function (title_id, data) {
|
|
12652
|
+
return Requests.processRoute(TitlesRoute.routes.progressionLeaderboardsStore, data, { title_id: title_id });
|
|
12653
|
+
};
|
|
12654
|
+
Titles.listProgressionSeasons = function (title_id) {
|
|
12655
|
+
return Requests.processRoute(TitlesRoute.routes.progressionSeasonsList, undefined, { title_id: title_id });
|
|
12656
|
+
};
|
|
12657
|
+
Titles.createProgressionSeason = function (title_id, data) {
|
|
12658
|
+
return Requests.processRoute(TitlesRoute.routes.progressionSeasonsStore, data, { title_id: title_id });
|
|
12659
|
+
};
|
|
12660
|
+
/**
|
|
12661
|
+
* Submit a gameplay run. Updates stats and scores using the install_id for privacy.
|
|
12662
|
+
* @param data { idempotency_key: string, payload: { stats: {}, scores: {} } }
|
|
12663
|
+
*/
|
|
12664
|
+
Titles.submitProgressionRun = function (title_id, install_id, data) {
|
|
12665
|
+
return Requests.processRoute(TitlesRoute.routes.progressionSubmit, data, { title_id: title_id, install_id: install_id });
|
|
12666
|
+
};
|
|
12667
|
+
Titles.getProgressionPlayerStats = function (title_id, install_id) {
|
|
12668
|
+
return Requests.processRoute(TitlesRoute.routes.progressionPlayerStats, undefined, { title_id: title_id, install_id: install_id });
|
|
12669
|
+
};
|
|
12670
|
+
Titles.getProgressionPlayerAchievements = function (title_id, install_id) {
|
|
12671
|
+
return Requests.processRoute(TitlesRoute.routes.progressionPlayerAchievements, undefined, { title_id: title_id, install_id: install_id });
|
|
12672
|
+
};
|
|
12673
|
+
/**
|
|
12674
|
+
* View leaderboard rankings.
|
|
12675
|
+
* @param params Optional filters like { around_me: true, install_id: 'uuid', season_id: 'uuid' }
|
|
12676
|
+
*/
|
|
12677
|
+
Titles.getProgressionLeaderboard = function (title_id, api_key, params) {
|
|
12678
|
+
return Requests.processRoute(TitlesRoute.routes.progressionLeaderboardView, undefined, { title_id: title_id, api_key: api_key }, params);
|
|
12679
|
+
};
|
|
12596
12680
|
return Titles;
|
|
12597
12681
|
}());
|
|
12598
12682
|
|