glitch-javascript-sdk 2.8.4 → 2.8.6
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 +42 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Titles.d.ts +12 -0
- package/dist/esm/config/Config.d.ts +15 -0
- package/dist/esm/index.js +42 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +27 -0
- package/package.json +1 -1
- package/src/api/Titles.ts +24 -3
- package/src/config/Config.ts +30 -2
- package/src/routes/TitlesRoute.ts +4 -0
package/dist/esm/api/Titles.d.ts
CHANGED
|
@@ -519,5 +519,17 @@ declare class Titles {
|
|
|
519
519
|
* @param title_id The UUID of the title.
|
|
520
520
|
*/
|
|
521
521
|
static listBuilds<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
522
|
+
/**
|
|
523
|
+
* List all cloud save slots for the player associated with this install.
|
|
524
|
+
*/
|
|
525
|
+
static listSaves<T>(title_id: string, install_id: string): AxiosPromise<Response<T>>;
|
|
526
|
+
/**
|
|
527
|
+
* Upload game progress. The user is identified by the install_id.
|
|
528
|
+
*/
|
|
529
|
+
static storeSave<T>(title_id: string, install_id: string, data: object): AxiosPromise<Response<T>>;
|
|
530
|
+
/**
|
|
531
|
+
* Resolve a conflict.
|
|
532
|
+
*/
|
|
533
|
+
static resolveSaveConflict<T>(title_id: string, install_id: string, save_id: string, conflict_id: string, choice: 'keep_server' | 'use_client'): AxiosPromise<Response<T>>;
|
|
522
534
|
}
|
|
523
535
|
export default Titles;
|
|
@@ -24,12 +24,20 @@ declare class Config {
|
|
|
24
24
|
* @param lock If set to true, will lock the baseUrl so it cannot be changed
|
|
25
25
|
*/
|
|
26
26
|
static setBaseUrl(baseUrl: string, lock?: boolean): void;
|
|
27
|
+
/**
|
|
28
|
+
* Gets the base URL
|
|
29
|
+
*/
|
|
30
|
+
static getBaseUrl(): string;
|
|
27
31
|
/**
|
|
28
32
|
* Set the JSON Web Token (JWT) that will be passed to the API
|
|
29
33
|
*
|
|
30
34
|
* @param authToken The JWT
|
|
31
35
|
*/
|
|
32
36
|
static setAuthToken(authToken: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Gets the auth token
|
|
39
|
+
*/
|
|
40
|
+
static getAuthToken(): string;
|
|
33
41
|
/**
|
|
34
42
|
* Set the community to be associated with this config through
|
|
35
43
|
*
|
|
@@ -43,6 +51,9 @@ declare class Config {
|
|
|
43
51
|
* @param domain The domain ie: example.com
|
|
44
52
|
*/
|
|
45
53
|
static setRootDomain(domain: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Gets the root domain
|
|
56
|
+
*/
|
|
46
57
|
static getRootDomain(): string;
|
|
47
58
|
/**
|
|
48
59
|
* Gets base url
|
|
@@ -56,5 +67,9 @@ declare class Config {
|
|
|
56
67
|
* Gets the community currently associated
|
|
57
68
|
*/
|
|
58
69
|
static get getCommunity(): object;
|
|
70
|
+
/**
|
|
71
|
+
* Checks if the base URL is locked
|
|
72
|
+
*/
|
|
73
|
+
static isBaseUrlLocked(): boolean;
|
|
59
74
|
}
|
|
60
75
|
export default Config;
|
package/dist/esm/index.js
CHANGED
|
@@ -5760,6 +5760,12 @@ var Config = /** @class */ (function () {
|
|
|
5760
5760
|
this._baseUrlLocked = true;
|
|
5761
5761
|
}
|
|
5762
5762
|
};
|
|
5763
|
+
/**
|
|
5764
|
+
* Gets the base URL
|
|
5765
|
+
*/
|
|
5766
|
+
Config.getBaseUrl = function () {
|
|
5767
|
+
return Config._baseUrl;
|
|
5768
|
+
};
|
|
5763
5769
|
/**
|
|
5764
5770
|
* Set the JSON Web Token (JWT) that will be passed to the API
|
|
5765
5771
|
*
|
|
@@ -5769,6 +5775,12 @@ var Config = /** @class */ (function () {
|
|
|
5769
5775
|
Config._authToken = authToken;
|
|
5770
5776
|
Requests.setAuthToken(authToken);
|
|
5771
5777
|
};
|
|
5778
|
+
/**
|
|
5779
|
+
* Gets the auth token
|
|
5780
|
+
*/
|
|
5781
|
+
Config.getAuthToken = function () {
|
|
5782
|
+
return Config._authToken;
|
|
5783
|
+
};
|
|
5772
5784
|
/**
|
|
5773
5785
|
* Set the community to be associated with this config through
|
|
5774
5786
|
*
|
|
@@ -5798,6 +5810,9 @@ var Config = /** @class */ (function () {
|
|
|
5798
5810
|
this._rootDomain = formattedDomain;
|
|
5799
5811
|
Storage.setRootDomain(formattedDomain);
|
|
5800
5812
|
};
|
|
5813
|
+
/**
|
|
5814
|
+
* Gets the root domain
|
|
5815
|
+
*/
|
|
5801
5816
|
Config.getRootDomain = function () {
|
|
5802
5817
|
return this._rootDomain;
|
|
5803
5818
|
};
|
|
@@ -5831,6 +5846,12 @@ var Config = /** @class */ (function () {
|
|
|
5831
5846
|
enumerable: false,
|
|
5832
5847
|
configurable: true
|
|
5833
5848
|
});
|
|
5849
|
+
/**
|
|
5850
|
+
* Checks if the base URL is locked
|
|
5851
|
+
*/
|
|
5852
|
+
Config.isBaseUrlLocked = function () {
|
|
5853
|
+
return this._baseUrlLocked;
|
|
5854
|
+
};
|
|
5834
5855
|
Config._baseUrlLocked = false;
|
|
5835
5856
|
return Config;
|
|
5836
5857
|
}());
|
|
@@ -11720,6 +11741,9 @@ var TitlesRoute = /** @class */ (function () {
|
|
|
11720
11741
|
method: HTTP_METHODS.POST
|
|
11721
11742
|
},
|
|
11722
11743
|
listBuilds: { url: '/titles/{title_id}/deployments', method: HTTP_METHODS.GET },
|
|
11744
|
+
listSaves: { url: '/titles/{title_id}/installs/{install_id}/saves', method: HTTP_METHODS.GET },
|
|
11745
|
+
storeSave: { url: '/titles/{title_id}/installs/{install_id}/saves', method: HTTP_METHODS.POST },
|
|
11746
|
+
resolveSaveConflict: { url: '/titles/{title_id}/installs/{install_id}/saves/{save_id}/resolve', method: HTTP_METHODS.POST },
|
|
11723
11747
|
};
|
|
11724
11748
|
return TitlesRoute;
|
|
11725
11749
|
}());
|
|
@@ -12399,6 +12423,24 @@ var Titles = /** @class */ (function () {
|
|
|
12399
12423
|
Titles.listBuilds = function (title_id, params) {
|
|
12400
12424
|
return Requests.processRoute(TitlesRoute.routes.listBuilds, {}, { title_id: title_id }, params);
|
|
12401
12425
|
};
|
|
12426
|
+
/**
|
|
12427
|
+
* List all cloud save slots for the player associated with this install.
|
|
12428
|
+
*/
|
|
12429
|
+
Titles.listSaves = function (title_id, install_id) {
|
|
12430
|
+
return Requests.processRoute(TitlesRoute.routes.listSaves, {}, { title_id: title_id, install_id: install_id });
|
|
12431
|
+
};
|
|
12432
|
+
/**
|
|
12433
|
+
* Upload game progress. The user is identified by the install_id.
|
|
12434
|
+
*/
|
|
12435
|
+
Titles.storeSave = function (title_id, install_id, data) {
|
|
12436
|
+
return Requests.processRoute(TitlesRoute.routes.storeSave, data, { title_id: title_id, install_id: install_id });
|
|
12437
|
+
};
|
|
12438
|
+
/**
|
|
12439
|
+
* Resolve a conflict.
|
|
12440
|
+
*/
|
|
12441
|
+
Titles.resolveSaveConflict = function (title_id, install_id, save_id, conflict_id, choice) {
|
|
12442
|
+
return Requests.processRoute(TitlesRoute.routes.resolveSaveConflict, { conflict_id: conflict_id, choice: choice }, { title_id: title_id, install_id: install_id, save_id: save_id });
|
|
12443
|
+
};
|
|
12402
12444
|
return Titles;
|
|
12403
12445
|
}());
|
|
12404
12446
|
|