glitch-javascript-sdk 3.9.5 → 3.9.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.
@@ -4,6 +4,31 @@ export type GameReviewRecommendation = 'recommended' | 'not_recommended' | 'neut
4
4
  export type GameReviewSentiment = 'positive' | 'mixed' | 'negative';
5
5
  export type GameReviewVoteType = 'helpful' | 'funny' | 'detailed' | 'not_helpful';
6
6
  export type GameReviewReportReason = 'abuse' | 'spam' | 'off_topic' | 'manipulation' | 'hate' | 'personal_info' | 'other';
7
+ export type TitleTokenPurpose = 'install' | 'deploy' | 'hosting';
8
+ export type TitleTokenAbility = 'deployments:*' | 'deployments:create' | 'deployments:read' | 'deployments:activate' | 'hosting:*' | 'hosting:read' | 'hosting:deploy' | 'hosting:promote';
9
+ export interface CreateTitleTokenRequest {
10
+ expires_at?: string;
11
+ name?: string;
12
+ purpose?: TitleTokenPurpose;
13
+ abilities?: TitleTokenAbility[];
14
+ }
15
+ export interface TitleToken {
16
+ id: string;
17
+ title_id: string;
18
+ name?: string | null;
19
+ purpose: TitleTokenPurpose;
20
+ token_prefix: string;
21
+ abilities: TitleTokenAbility[];
22
+ expires_at?: string | null;
23
+ revoked: boolean;
24
+ last_used_at?: string | null;
25
+ created_at?: string;
26
+ }
27
+ export interface CreatedTitleToken {
28
+ /** Full secret value. Returned once and never retrievable again. */
29
+ full_token: string;
30
+ token: TitleToken;
31
+ }
7
32
  export interface GameReviewRatings {
8
33
  gameplay?: GameReviewSentiment;
9
34
  performance?: GameReviewSentiment;
@@ -212,17 +237,15 @@ declare class Titles {
212
237
  * Create a new API token for a title.
213
238
  * Returns { full_token: string, token: TitleToken }.
214
239
  */
215
- static createTitleToken<T>(title_id: string, data?: {
216
- expires_at?: string;
217
- }): AxiosPromise<Response<T>>;
240
+ static createTitleToken<T = CreatedTitleToken>(title_id: string, data?: CreateTitleTokenRequest): AxiosPromise<Response<T>>;
218
241
  /**
219
242
  * List all tokens for a title.
220
243
  */
221
- static listTitleTokens<T>(title_id: string): AxiosPromise<Response<T>>;
244
+ static listTitleTokens<T = TitleToken[]>(title_id: string): AxiosPromise<Response<T>>;
222
245
  /**
223
246
  * Revoke a specific token by ID.
224
247
  */
225
- static revokeTitleToken<T>(title_id: string, token_id: string): AxiosPromise<Response<T>>;
248
+ static revokeTitleToken<T = TitleToken>(title_id: string, token_id: string): AxiosPromise<Response<T>>;
226
249
  /**
227
250
  * Search for Titles using Meilisearch or fallback based on the query and filters.
228
251
  *