glitch-javascript-sdk 3.4.0 → 3.4.1
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 +27 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/GameShows.d.ts +17 -0
- package/dist/esm/index.js +27 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/GameShowsRoute.d.ts +4 -0
- package/dist/index.d.ts +17 -0
- package/package.json +1 -1
- package/src/api/GameShows.ts +19 -0
- package/src/routes/GameShowsRoute.ts +8 -1
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import Route from "./interface";
|
|
2
2
|
declare class GameShowsRoute {
|
|
3
|
+
/**
|
|
4
|
+
* Canonical API route templates. JSON routes are substituted by
|
|
5
|
+
* Requests.processRoute; multipart methods replace tokens before upload.
|
|
6
|
+
*/
|
|
3
7
|
static routes: {
|
|
4
8
|
[key: string]: Route;
|
|
5
9
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -6205,7 +6205,9 @@ declare class GameShows {
|
|
|
6205
6205
|
* Add a title to a game show by admin.
|
|
6206
6206
|
*/
|
|
6207
6207
|
static addTitle<T>(show_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6208
|
+
/** Preview CSV/TSV/TXT/ZIP registrations without writing showcase data. */
|
|
6208
6209
|
static previewExternalTitles<T>(show_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6210
|
+
/** Import valid external registrations after organizer preview. */
|
|
6209
6211
|
static importExternalTitles<T>(show_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6210
6212
|
/**
|
|
6211
6213
|
* List all titles for a game show.
|
|
@@ -6283,20 +6285,35 @@ declare class GameShows {
|
|
|
6283
6285
|
* List public game shows that include a title. Useful for game-page festival banners.
|
|
6284
6286
|
*/
|
|
6285
6287
|
static listForTitle<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6288
|
+
/** List private sponsor workflow, contact, billing, media, and placements. */
|
|
6286
6289
|
static listSponsors<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6290
|
+
/** Create a manual sponsor or send a self-service invitation. */
|
|
6287
6291
|
static createSponsor<T>(show_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6292
|
+
/** Retrieve one organizer-authorized festival sponsor. */
|
|
6288
6293
|
static getSponsor<T>(show_id: string, sponsor_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6294
|
+
/** Update sponsor workflow, creative metadata, schedule, or billing terms. */
|
|
6289
6295
|
static updateSponsor<T>(show_id: string, sponsor_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6296
|
+
/** Delete an unpaid sponsor and its placements. */
|
|
6290
6297
|
static deleteSponsor<T>(show_id: string, sponsor_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6298
|
+
/** Replace the private token and resend the sponsor invitation. */
|
|
6291
6299
|
static resendSponsorInvitation<T>(show_id: string, sponsor_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6300
|
+
/** Add another festival, game, session, or event placement. */
|
|
6292
6301
|
static createSponsorPlacement<T>(show_id: string, sponsor_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6302
|
+
/** Partially update an existing sponsor placement. */
|
|
6293
6303
|
static updateSponsorPlacement<T>(show_id: string, sponsor_id: string, placement_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6304
|
+
/** Delete one placement without deleting the sponsor creative. */
|
|
6294
6305
|
static deleteSponsorPlacement<T>(show_id: string, sponsor_id: string, placement_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6306
|
+
/** List privacy-limited, publicly eligible creatives and placements. */
|
|
6295
6307
|
static listPublicSponsors<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6308
|
+
/** Open a token-protected sponsor portal without a user session. */
|
|
6296
6309
|
static sponsorInvitation<T>(token: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6310
|
+
/** Upload sponsor image/video through the shared Media pipeline. */
|
|
6297
6311
|
static uploadSponsorInvitationMedia<T>(token: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6312
|
+
/** Submit sponsor identity, destination, and accessibility metadata. */
|
|
6298
6313
|
static submitSponsorInvitation<T>(token: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6314
|
+
/** Create/confirm a destination PaymentIntent from a PaymentMethod ID. */
|
|
6299
6315
|
static paySponsorInvitation<T>(token: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6316
|
+
/** Synchronize the same intent after Stripe.js completes required 3DS. */
|
|
6300
6317
|
static confirmSponsorInvitationPayment<T>(token: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6301
6318
|
}
|
|
6302
6319
|
|
package/package.json
CHANGED
package/src/api/GameShows.ts
CHANGED
|
@@ -154,11 +154,14 @@ class GameShows {
|
|
|
154
154
|
return Requests.processRoute(GameShowsRoute.routes.addTitle, data, { show_id: show_id }, params);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
/** Preview CSV/TSV/TXT/ZIP registrations without writing showcase data. */
|
|
157
158
|
public static previewExternalTitles<T>(show_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
159
|
+
// Multipart helpers require the concrete URL before uploading.
|
|
158
160
|
const url = GameShowsRoute.routes.previewExternalTitles.url.replace('{show_id}', show_id);
|
|
159
161
|
return Requests.uploadFile(url, 'file', file, data, params);
|
|
160
162
|
}
|
|
161
163
|
|
|
164
|
+
/** Import valid external registrations after organizer preview. */
|
|
162
165
|
public static importExternalTitles<T>(show_id: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
163
166
|
const url = GameShowsRoute.routes.importExternalTitles.url.replace('{show_id}', show_id);
|
|
164
167
|
return Requests.uploadFile(url, 'file', file, data, params);
|
|
@@ -297,63 +300,79 @@ class GameShows {
|
|
|
297
300
|
return Requests.processRoute(GameShowsRoute.routes.listForTitle, {}, { title_id: title_id }, params);
|
|
298
301
|
}
|
|
299
302
|
|
|
303
|
+
/** List private sponsor workflow, contact, billing, media, and placements. */
|
|
300
304
|
public static listSponsors<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
301
305
|
return Requests.processRoute(GameShowsRoute.routes.listSponsors, {}, { show_id }, params);
|
|
302
306
|
}
|
|
303
307
|
|
|
308
|
+
/** Create a manual sponsor or send a self-service invitation. */
|
|
304
309
|
public static createSponsor<T>(show_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
305
310
|
return Requests.processRoute(GameShowsRoute.routes.createSponsor, data, { show_id }, params);
|
|
306
311
|
}
|
|
307
312
|
|
|
313
|
+
/** Retrieve one organizer-authorized festival sponsor. */
|
|
308
314
|
public static getSponsor<T>(show_id: string, sponsor_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
309
315
|
return Requests.processRoute(GameShowsRoute.routes.getSponsor, {}, { show_id, sponsor_id }, params);
|
|
310
316
|
}
|
|
311
317
|
|
|
318
|
+
/** Update sponsor workflow, creative metadata, schedule, or billing terms. */
|
|
312
319
|
public static updateSponsor<T>(show_id: string, sponsor_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
313
320
|
return Requests.processRoute(GameShowsRoute.routes.updateSponsor, data, { show_id, sponsor_id }, params);
|
|
314
321
|
}
|
|
315
322
|
|
|
323
|
+
/** Delete an unpaid sponsor and its placements. */
|
|
316
324
|
public static deleteSponsor<T>(show_id: string, sponsor_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
317
325
|
return Requests.processRoute(GameShowsRoute.routes.deleteSponsor, {}, { show_id, sponsor_id }, params);
|
|
318
326
|
}
|
|
319
327
|
|
|
328
|
+
/** Replace the private token and resend the sponsor invitation. */
|
|
320
329
|
public static resendSponsorInvitation<T>(show_id: string, sponsor_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
321
330
|
return Requests.processRoute(GameShowsRoute.routes.resendSponsorInvitation, {}, { show_id, sponsor_id }, params);
|
|
322
331
|
}
|
|
323
332
|
|
|
333
|
+
/** Add another festival, game, session, or event placement. */
|
|
324
334
|
public static createSponsorPlacement<T>(show_id: string, sponsor_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
325
335
|
return Requests.processRoute(GameShowsRoute.routes.createSponsorPlacement, data, { show_id, sponsor_id }, params);
|
|
326
336
|
}
|
|
327
337
|
|
|
338
|
+
/** Partially update an existing sponsor placement. */
|
|
328
339
|
public static updateSponsorPlacement<T>(show_id: string, sponsor_id: string, placement_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
329
340
|
return Requests.processRoute(GameShowsRoute.routes.updateSponsorPlacement, data, { show_id, sponsor_id, placement_id }, params);
|
|
330
341
|
}
|
|
331
342
|
|
|
343
|
+
/** Delete one placement without deleting the sponsor creative. */
|
|
332
344
|
public static deleteSponsorPlacement<T>(show_id: string, sponsor_id: string, placement_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
333
345
|
return Requests.processRoute(GameShowsRoute.routes.deleteSponsorPlacement, {}, { show_id, sponsor_id, placement_id }, params);
|
|
334
346
|
}
|
|
335
347
|
|
|
348
|
+
/** List privacy-limited, publicly eligible creatives and placements. */
|
|
336
349
|
public static listPublicSponsors<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
337
350
|
return Requests.processRoute(GameShowsRoute.routes.listPublicSponsors, {}, { show_id }, params);
|
|
338
351
|
}
|
|
339
352
|
|
|
353
|
+
/** Open a token-protected sponsor portal without a user session. */
|
|
340
354
|
public static sponsorInvitation<T>(token: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
341
355
|
return Requests.processRoute(GameShowsRoute.routes.sponsorInvitation, {}, { token }, params);
|
|
342
356
|
}
|
|
343
357
|
|
|
358
|
+
/** Upload sponsor image/video through the shared Media pipeline. */
|
|
344
359
|
public static uploadSponsorInvitationMedia<T>(token: string, file: File, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
360
|
+
// Sponsor uploads use the `media` multipart field documented by API.
|
|
345
361
|
const url = GameShowsRoute.routes.sponsorInvitationUpload.url.replace('{token}', token);
|
|
346
362
|
return Requests.uploadFile(url, 'media', file, data, params);
|
|
347
363
|
}
|
|
348
364
|
|
|
365
|
+
/** Submit sponsor identity, destination, and accessibility metadata. */
|
|
349
366
|
public static submitSponsorInvitation<T>(token: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
350
367
|
return Requests.processRoute(GameShowsRoute.routes.sponsorInvitationSubmit, data, { token }, params);
|
|
351
368
|
}
|
|
352
369
|
|
|
370
|
+
/** Create/confirm a destination PaymentIntent from a PaymentMethod ID. */
|
|
353
371
|
public static paySponsorInvitation<T>(token: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
354
372
|
return Requests.processRoute(GameShowsRoute.routes.sponsorInvitationPayment, data, { token }, params);
|
|
355
373
|
}
|
|
356
374
|
|
|
375
|
+
/** Synchronize the same intent after Stripe.js completes required 3DS. */
|
|
357
376
|
public static confirmSponsorInvitationPayment<T>(token: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
358
377
|
return Requests.processRoute(GameShowsRoute.routes.sponsorInvitationConfirmPayment, {}, { token }, params);
|
|
359
378
|
}
|
|
@@ -2,7 +2,10 @@ import Route from "./interface";
|
|
|
2
2
|
import HTTP_METHODS from "../constants/HttpMethods";
|
|
3
3
|
|
|
4
4
|
class GameShowsRoute {
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Canonical API route templates. JSON routes are substituted by
|
|
7
|
+
* Requests.processRoute; multipart methods replace tokens before upload.
|
|
8
|
+
*/
|
|
6
9
|
public static routes: { [key: string]: Route } = {
|
|
7
10
|
list: { url: '/gameshows', method: HTTP_METHODS.GET },
|
|
8
11
|
create: { url: '/gameshows', method: HTTP_METHODS.POST },
|
|
@@ -14,6 +17,7 @@ class GameShowsRoute {
|
|
|
14
17
|
registerTitle: { url: '/gameshows/{show_id}/registerTitle', method: HTTP_METHODS.POST },
|
|
15
18
|
listTitles: { url: '/gameshows/{show_id}/titles', method: HTTP_METHODS.GET },
|
|
16
19
|
addTitle: { url: '/gameshows/{show_id}/addTitle', method: HTTP_METHODS.POST },
|
|
20
|
+
// External registration file preview/import endpoints.
|
|
17
21
|
previewExternalTitles: { url: '/gameshows/{show_id}/external-titles/preview', method: HTTP_METHODS.POST },
|
|
18
22
|
importExternalTitles: { url: '/gameshows/{show_id}/external-titles/import', method: HTTP_METHODS.POST },
|
|
19
23
|
viewTitle: { url: '/gameshows/{show_id}/titles/{title_id}', method: HTTP_METHODS.GET },
|
|
@@ -34,6 +38,7 @@ class GameShowsRoute {
|
|
|
34
38
|
joinWishlist: { url: '/gameshows/{show_id}/wishlist', method: HTTP_METHODS.POST },
|
|
35
39
|
listWishlist: { url: '/gameshows/{show_id}/wishlist', method: HTTP_METHODS.GET },
|
|
36
40
|
listForTitle: { url: '/titles/{title_id}/gameshows', method: HTTP_METHODS.GET },
|
|
41
|
+
// Organizer sponsor lifecycle and placement administration.
|
|
37
42
|
listSponsors: { url: '/gameshows/{show_id}/sponsors', method: HTTP_METHODS.GET },
|
|
38
43
|
createSponsor: { url: '/gameshows/{show_id}/sponsors', method: HTTP_METHODS.POST },
|
|
39
44
|
getSponsor: { url: '/gameshows/{show_id}/sponsors/{sponsor_id}', method: HTTP_METHODS.GET },
|
|
@@ -43,7 +48,9 @@ class GameShowsRoute {
|
|
|
43
48
|
createSponsorPlacement: { url: '/gameshows/{show_id}/sponsors/{sponsor_id}/placements', method: HTTP_METHODS.POST },
|
|
44
49
|
updateSponsorPlacement: { url: '/gameshows/{show_id}/sponsors/{sponsor_id}/placements/{placement_id}', method: HTTP_METHODS.PUT },
|
|
45
50
|
deleteSponsorPlacement: { url: '/gameshows/{show_id}/sponsors/{sponsor_id}/placements/{placement_id}', method: HTTP_METHODS.DELETE },
|
|
51
|
+
// Privacy-limited anonymous sponsor inventory.
|
|
46
52
|
listPublicSponsors: { url: '/gameshows/{show_id}/sponsors/public', method: HTTP_METHODS.GET },
|
|
53
|
+
// Token-protected sponsor self-service; backend applies per-route limits.
|
|
47
54
|
sponsorInvitation: { url: '/gameshow-sponsor-invitations/{token}', method: HTTP_METHODS.GET },
|
|
48
55
|
sponsorInvitationUpload: { url: '/gameshow-sponsor-invitations/{token}/media', method: HTTP_METHODS.POST },
|
|
49
56
|
sponsorInvitationSubmit: { url: '/gameshow-sponsor-invitations/{token}/submit', method: HTTP_METHODS.POST },
|