glitch-javascript-sdk 3.10.7 → 3.15.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.
@@ -0,0 +1,286 @@
1
+ import { AxiosProgressEvent, AxiosPromise, AxiosRequestConfig } from 'axios';
2
+ export type FestivalPostKind = 'discussion' | 'job' | 'talent';
3
+ export type FestivalPostState = 'active' | 'locked' | 'archived' | 'hidden' | 'deleted' | 'removed' | 'paused' | 'filled' | 'expired' | 'closed';
4
+ export type FestivalApplicationState = 'submitted' | 'viewed' | 'shortlisted' | 'interview' | 'accepted' | 'rejected' | 'withdrawn' | 'closed';
5
+ export type FestivalWorkType = 'full_time' | 'part_time' | 'contract' | 'gig';
6
+ export type FestivalRequestOptions = Pick<AxiosRequestConfig, 'signal' | 'timeout'>;
7
+ export interface FestivalNetworkingSettings {
8
+ discussions_enabled: boolean;
9
+ jobs_enabled: boolean;
10
+ employer_posts_enabled: boolean;
11
+ talent_posts_enabled: boolean;
12
+ matching_enabled: boolean;
13
+ voting_enabled: boolean;
14
+ comments_enabled: boolean;
15
+ media_enabled: boolean;
16
+ /** Registration or a valid ticket is mandatory; cannot be disabled. */
17
+ require_registration: true;
18
+ public_viewing: false;
19
+ anonymous_enabled: false;
20
+ categories: string[];
21
+ skills: string[];
22
+ }
23
+ export interface FestivalPostInput {
24
+ kind: FestivalPostKind;
25
+ title: string;
26
+ /** Sanitized HTML from the shared WYSIWYG editor. */
27
+ content: string;
28
+ visibility?: 'public' | 'unlisted' | 'private';
29
+ category?: string | null;
30
+ tags?: string[];
31
+ skills?: string[];
32
+ preferred_skills?: string[];
33
+ job_types?: FestivalWorkType[];
34
+ company?: string | null;
35
+ organization_id?: string | null;
36
+ work_arrangement?: 'remote' | 'onsite' | 'hybrid' | null;
37
+ experience?: 'any' | 'entry' | 'junior' | 'mid' | 'senior' | 'lead' | null;
38
+ location?: string | null;
39
+ availability?: 'immediately' | 'within_30_days' | 'specific_date' | 'flexible' | 'unavailable';
40
+ availability_date?: string | null;
41
+ deadline?: string | null;
42
+ expires_at?: string | null;
43
+ compensation_type?: 'negotiable' | 'yearly' | 'monthly' | 'hourly' | 'flat_fee';
44
+ compensation_min?: number | null;
45
+ compensation_max?: number | null;
46
+ currency?: string | null;
47
+ portfolio_url?: string | null;
48
+ application_method?: 'internal' | 'external';
49
+ application_url?: string | null;
50
+ /** UserMedia IDs returned by uploadMedia, NOT Media IDs or clip-library selections. Max 8. */
51
+ media_ids?: string[];
52
+ public_compensation?: boolean;
53
+ public_location?: boolean;
54
+ public_availability?: boolean;
55
+ public_portfolio?: boolean;
56
+ }
57
+ export interface FestivalNetworkingFilters {
58
+ kind?: FestivalPostKind;
59
+ view?: 'all' | 'mine' | 'saved' | 'hidden' | 'comments';
60
+ sort?: 'new' | 'hot' | 'top' | 'discussed' | 'compensation' | 'deadline';
61
+ window?: 'today' | 'week' | 'month' | 'festival' | 'all';
62
+ q?: string;
63
+ category?: string;
64
+ skill?: string;
65
+ job_type?: FestivalWorkType;
66
+ arrangement?: 'remote' | 'onsite' | 'hybrid';
67
+ experience?: string;
68
+ location?: string;
69
+ company?: string;
70
+ availability?: string;
71
+ currency?: string;
72
+ compensation_type?: string;
73
+ min_compensation?: number;
74
+ tag?: string;
75
+ author?: string;
76
+ has_comments?: boolean;
77
+ has_portfolio?: boolean;
78
+ media_type?: 'image' | 'video';
79
+ page?: number;
80
+ per_page?: number;
81
+ }
82
+ export interface FestivalMediaUpload {
83
+ id: string;
84
+ user_media_id: string;
85
+ media_id: string;
86
+ url: string;
87
+ mime_type: string;
88
+ size: number;
89
+ title: string;
90
+ processing_status: 'completed' | 'pending' | 'processing' | 'failed';
91
+ }
92
+ export interface FestivalNetworkingProfile {
93
+ id: string | null;
94
+ name: string;
95
+ }
96
+ export interface FestivalNetworkingResponse<T> {
97
+ data: T;
98
+ message?: string;
99
+ meta?: {
100
+ current_page: number;
101
+ last_page: number;
102
+ total?: number;
103
+ };
104
+ has_access?: boolean;
105
+ can_manage?: boolean;
106
+ can_moderate?: boolean;
107
+ user?: FestivalNetworkingProfile | null;
108
+ show?: {
109
+ id: string;
110
+ name: string;
111
+ };
112
+ audit?: Array<Record<string, unknown>>;
113
+ }
114
+ export interface FestivalPost {
115
+ id: string;
116
+ game_show_id: string;
117
+ parent_id: string | null;
118
+ kind: FestivalPostKind | 'comment';
119
+ title: string;
120
+ content: string;
121
+ state: FestivalPostState;
122
+ visibility: 'public' | 'unlisted' | 'private';
123
+ details: Partial<FestivalPostInput>;
124
+ author: FestivalNetworkingProfile | null;
125
+ created_at: string;
126
+ updated_at: string;
127
+ score: number;
128
+ my_vote: -1 | 0 | 1;
129
+ saved: boolean;
130
+ is_owner: boolean;
131
+ can_edit: boolean;
132
+ comment_count: number;
133
+ media: Array<{
134
+ id: string;
135
+ user_media_id?: string | null;
136
+ url: string;
137
+ mime_type: string;
138
+ title: string | null;
139
+ }>;
140
+ my_application?: {
141
+ id: string;
142
+ status: FestivalApplicationState;
143
+ } | null;
144
+ match?: {
145
+ score: number;
146
+ reasons: string[];
147
+ missing_required_skills: string[];
148
+ disclaimer: string;
149
+ };
150
+ }
151
+ export interface FestivalApplicationInput {
152
+ message?: string;
153
+ portfolio?: string[];
154
+ }
155
+ export interface FestivalConversation {
156
+ id: string;
157
+ festival_application_id: string;
158
+ can_send: boolean;
159
+ read_only_reason: string | null;
160
+ festival_context: {
161
+ game_show_id: string;
162
+ post_id: string | null;
163
+ title: string;
164
+ kind: FestivalPostKind;
165
+ application_status: FestivalApplicationState;
166
+ } | null;
167
+ users: Array<{
168
+ id: string | null;
169
+ display_name: string;
170
+ avatar: string | null;
171
+ }>;
172
+ messages: Array<{
173
+ id: string;
174
+ thread_id: string;
175
+ user_id: string | null;
176
+ message: string;
177
+ client_message_id: string | null;
178
+ created_at: string;
179
+ updated_at: string;
180
+ user: {
181
+ id: string | null;
182
+ display_name: string;
183
+ avatar: string | null;
184
+ };
185
+ }>;
186
+ }
187
+ export interface FestivalPreferences {
188
+ notifications?: boolean;
189
+ blocked_users?: string[];
190
+ blocked_companies?: string[];
191
+ }
192
+ export interface FestivalReportInput {
193
+ reason: 'spam' | 'harassment' | 'hate' | 'sexual_content' | 'scam' | 'job_scam' | 'copyright' | 'malicious_link' | 'misleading' | 'other';
194
+ explanation?: string;
195
+ }
196
+ /** Festival-scoped discussions, talent, jobs, moderation and new owned media uploads. */
197
+ export default class FestivalNetworking {
198
+ private static request;
199
+ /** Read enabled tools and the current account's registration/ticket access. */
200
+ static settings<T = FestivalNetworkingSettings>(id: string, options?: FestivalRequestOptions): AxiosPromise<FestivalNetworkingResponse<T>>;
201
+ /** Organizer-only settings update; admission remains mandatory. */
202
+ static updateSettings<T = FestivalNetworkingSettings>(id: string, data: Partial<FestivalNetworkingSettings>): AxiosPromise<FestivalNetworkingResponse<T>>;
203
+ /** Search posts; compensation comparisons require currency and period. */
204
+ static listPosts<T = FestivalPost[]>(id: string, params?: FestivalNetworkingFilters, options?: FestivalRequestOptions): AxiosPromise<FestivalNetworkingResponse<T>>;
205
+ /** Create a post with rich HTML and optional newly uploaded UserMedia IDs. */
206
+ static createPost<T = FestivalPost>(id: string, data: FestivalPostInput): AxiosPromise<FestivalNetworkingResponse<T>>;
207
+ /** Direct links still require admission and content visibility permission. */
208
+ static getPost<T = FestivalPost>(id: string, post_id: string, options?: FestivalRequestOptions): AxiosPromise<FestivalNetworkingResponse<T>>;
209
+ /** Edit or soft-delete via state; omit media_ids to preserve current attachments. */
210
+ static updatePost<T = FestivalPost>(id: string, post_id: string, data: Partial<FestivalPostInput> & {
211
+ state?: FestivalPostState;
212
+ }): AxiosPromise<FestivalNetworkingResponse<T>>;
213
+ /** Paginated direct replies; fetch children to expand a thread. */
214
+ static listComments<T = FestivalPost[]>(id: string, post_id: string, params?: {
215
+ page?: number;
216
+ }, options?: FestivalRequestOptions): AxiosPromise<FestivalNetworkingResponse<T>>;
217
+ /** Add a rich-text reply, subject to locking and five-level nesting. */
218
+ static createComment<T = FestivalPost>(id: string, post_id: string, data: {
219
+ content: string;
220
+ }): AxiosPromise<FestivalNetworkingResponse<T>>;
221
+ /** Set, replace, or remove a vote/save/hide idempotently. */
222
+ static setInteraction<T = FestivalPost>(id: string, post_id: string, data: {
223
+ action: 'vote' | 'saved' | 'hidden';
224
+ value: -1 | 0 | 1;
225
+ }): AxiosPromise<FestivalNetworkingResponse<T>>;
226
+ /** Apply or express interest once; the original listing is snapshotted. */
227
+ static apply<T = Record<string, unknown>>(id: string, post_id: string, data: FestivalApplicationInput): AxiosPromise<FestivalNetworkingResponse<T>>;
228
+ /** Discovery matches for the current user's own job/talent listing. */
229
+ static matches<T = FestivalPost[]>(id: string, post_id: string, params?: {
230
+ page?: number;
231
+ }, options?: FestivalRequestOptions): AxiosPromise<FestivalNetworkingResponse<T>>;
232
+ /** Report suspicious content privately to festival moderators. */
233
+ static report<T = never>(id: string, post_id: string, data: FestivalReportInput): AxiosPromise<FestivalNetworkingResponse<T>>;
234
+ /** Only the applicant and listing owner receive application records. */
235
+ static applications<T = Array<Record<string, unknown>>>(id: string, params?: {
236
+ page?: number;
237
+ }, options?: FestivalRequestOptions): AxiosPromise<FestivalNetworkingResponse<T>>;
238
+ /** Applicant withdrawal or owner-managed status changes. */
239
+ static updateApplication<T = Record<string, unknown>>(id: string, application_id: string, data: {
240
+ status: Exclude<FestivalApplicationState, 'submitted'>;
241
+ }): AxiosPromise<FestivalNetworkingResponse<T>>;
242
+ /** Open the application/talent inquiry's private shared-inbox conversation, creating it once for legacy applications. Only the applicant and original listing owner may call this. Use Messages.getThread/sendMessage for subsequent conversation activity. */
243
+ static conversation<T = FestivalConversation>(id: string, application_id: string): AxiosPromise<FestivalNetworkingResponse<T>>;
244
+ /** Moderator-only report queue and audit history. */
245
+ static moderation<T = Array<Record<string, unknown>>>(id: string, params?: {
246
+ page?: number;
247
+ }, options?: FestivalRequestOptions): AxiosPromise<FestivalNetworkingResponse<T>>;
248
+ /** Moderation remains available even while the board is disabled. */
249
+ static moderatePost<T = FestivalPost>(id: string, post_id: string, data: {
250
+ state?: 'active' | 'hidden' | 'locked' | 'deleted' | 'removed';
251
+ remove_media?: true;
252
+ }): AxiosPromise<FestivalNetworkingResponse<T>>;
253
+ /** Resolve, dismiss or begin reviewing a report. */
254
+ static resolveReport<T = never>(id: string, report_id: string, data: {
255
+ status: 'under_review' | 'resolved' | 'dismissed';
256
+ }): AxiosPromise<FestivalNetworkingResponse<T>>;
257
+ /** Moderator-only participant restrictions. */
258
+ static restrictMember<T = never>(id: string, user_id: string, data: {
259
+ banned: boolean;
260
+ }): AxiosPromise<FestivalNetworkingResponse<T>>;
261
+ /** Current user's privacy and notification preferences. */
262
+ static preferences<T = FestivalPreferences>(id: string, options?: FestivalRequestOptions): AxiosPromise<FestivalNetworkingResponse<T>>;
263
+ /** Set notification opt-out and blocked participants/companies. */
264
+ static updatePreferences<T = FestivalPreferences>(id: string, data: FestivalPreferences): AxiosPromise<FestivalNetworkingResponse<T>>;
265
+ /** Uploaded festival attachments only; not the gameplay clip library. */
266
+ static media<T = Array<Record<string, unknown>>>(id: string, params?: {
267
+ page?: number;
268
+ }, options?: FestivalRequestOptions): AxiosPromise<FestivalNetworkingResponse<T>>;
269
+ /**
270
+ * Upload a new image (10 MB max) or video (100 MB max), using the existing media pipeline.
271
+ * The response ID is an owned UserMedia ID for createPost/updatePost media_ids.
272
+ * @param file New file selected by the attendee; supported images exclude SVG.
273
+ * @param data Which enabled board the upload is for.
274
+ * @param onUploadProgress Transfer progress; 100% may still require conversion before completion.
275
+ */
276
+ static uploadMedia<T = FestivalMediaUpload>(id: string, file: File | Blob, data: {
277
+ kind: FestivalPostKind;
278
+ }, onUploadProgress?: (event: AxiosProgressEvent) => void, options?: FestivalRequestOptions): AxiosPromise<FestivalNetworkingResponse<T>>;
279
+ /** Organizations the authenticated user is authorized to represent. */
280
+ static organizations<T = Array<{
281
+ id: string;
282
+ name: string;
283
+ }>>(id: string, options?: FestivalRequestOptions): AxiosPromise<FestivalNetworkingResponse<T>>;
284
+ /** Organizer-only aggregate participation metrics. */
285
+ static analytics<T = Record<string, unknown>>(id: string, options?: FestivalRequestOptions): AxiosPromise<FestivalNetworkingResponse<T>>;
286
+ }
@@ -30,6 +30,26 @@ export interface GameShowScheduleTicketRefundInput {
30
30
  amount_cents: number;
31
31
  reason?: string;
32
32
  }
33
+ export interface GameShowTitleCandidate {
34
+ id: string;
35
+ name: string;
36
+ developer?: string | null;
37
+ publisher?: string | null;
38
+ short_description?: string | null;
39
+ image_main?: string | null;
40
+ image_banner?: string | null;
41
+ is_live: boolean;
42
+ already_in_showcase: boolean;
43
+ community?: {
44
+ id: string;
45
+ name: string;
46
+ } | null;
47
+ }
48
+ export interface GameShowTitleCandidateSearchParams {
49
+ q: string;
50
+ page?: number;
51
+ per_page?: number;
52
+ }
33
53
  declare class GameShows {
34
54
  /**
35
55
  * List all the GameShows.
@@ -147,6 +167,8 @@ declare class GameShows {
147
167
  * Add a title to a game show by admin.
148
168
  */
149
169
  static addTitle<T>(show_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
170
+ /** Search privacy-safe registered Glitch games that an organizer may attach to a festival. */
171
+ static searchTitleCandidates<T>(show_id: string, params: GameShowTitleCandidateSearchParams): AxiosPromise<Response<T>>;
150
172
  /** Preview CSV/TSV/TXT/ZIP registrations without writing showcase data. */
151
173
  static previewExternalTitles<T>(show_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
152
174
  /** Import valid external registrations after organizer preview. */
@@ -10,7 +10,10 @@ declare class Messages {
10
10
  */
11
11
  static listMessageThreads<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
12
12
  /**
13
- * Send a new message that will be added to a thread
13
+ * Send a new message that will be added to a thread. Festival-scoped threads
14
+ * enforce current admission, blocking and read-only state server-side.
15
+ * Include an optional client_message_id UUID and reuse it when retrying a
16
+ * timed-out request to prevent duplicate messages and notifications.
14
17
  *
15
18
  * @see https://api.glitch.fun/api/documentation#/Messages/storeMessage
16
19
  *