glitch-javascript-sdk 3.7.0 → 3.8.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 +99 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/GameShows.d.ts +34 -0
- package/dist/esm/api/Scheduler.d.ts +100 -0
- package/dist/esm/index.js +99 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +134 -0
- package/package.json +2 -2
- package/src/api/GameShows.ts +80 -0
- package/src/api/Scheduler.ts +122 -0
- package/src/routes/GameShowsRoute.ts +17 -0
- package/src/routes/SchedulerRoute.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -6351,6 +6351,32 @@ declare class GameShows {
|
|
|
6351
6351
|
* List notification signups for a game show. Requires organizer permissions.
|
|
6352
6352
|
*/
|
|
6353
6353
|
static listWishlist<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6354
|
+
/** List the anonymous, published festival award/prize/swag catalog. */
|
|
6355
|
+
static listPublicRewards<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6356
|
+
/** Retrieve one SSR-ready public festival reward. */
|
|
6357
|
+
static getPublicReward<T>(show_id: string, reward_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6358
|
+
/** Retrieve a privacy-safe public game leaderboard for one reward. */
|
|
6359
|
+
static getPublicRewardLeaderboard<T>(show_id: string, reward_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6360
|
+
/** List drafts, sponsor items, inventory, recipients, and fulfillment for organizers. */
|
|
6361
|
+
static manageRewards<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6362
|
+
/** Claim an eligible attendee, entrant, points, or previously awarded festival reward. */
|
|
6363
|
+
static claimReward<T>(show_id: string, reward_id: string, data?: {
|
|
6364
|
+
title_id?: string;
|
|
6365
|
+
}, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6366
|
+
/** Create an organizer-controlled festival award, prize, swag item, or reward. */
|
|
6367
|
+
static createReward<T>(show_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6368
|
+
/** Update publication, eligibility, metrics, inventory, or rich content. */
|
|
6369
|
+
static updateReward<T>(show_id: string, reward_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6370
|
+
/** Soft-delete one festival reward. */
|
|
6371
|
+
static deleteReward<T>(show_id: string, reward_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6372
|
+
/** Preview the organizer-only game or attendee performance leaderboard. */
|
|
6373
|
+
static rewardLeaderboard<T>(show_id: string, reward_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6374
|
+
/** Snapshot current metric leaders as reward recipients. */
|
|
6375
|
+
static autoAwardReward<T>(show_id: string, reward_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6376
|
+
/** Add a manual nominee, winner, honoree, claimant, or fulfillment record. */
|
|
6377
|
+
static addRewardRecipient<T>(show_id: string, reward_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6378
|
+
/** Update judging, claim, revocation, rank, or fulfillment state. */
|
|
6379
|
+
static updateRewardRecipient<T>(show_id: string, reward_id: string, recipient_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6354
6380
|
/**
|
|
6355
6381
|
* List public game shows that include a title. Useful for game-page festival banners.
|
|
6356
6382
|
*/
|
|
@@ -6402,6 +6428,14 @@ declare class GameShows {
|
|
|
6402
6428
|
static paySponsorInvitation<T>(token: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6403
6429
|
/** Synchronize the same intent after Stripe.js completes required 3DS. */
|
|
6404
6430
|
static confirmSponsorInvitationPayment<T>(token: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6431
|
+
/** List awards, prizes, and swag owned by a sponsor invitation. */
|
|
6432
|
+
static sponsorInvitationRewards<T>(token: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6433
|
+
/** Create a draft sponsor-owned award, prize, or swag item. */
|
|
6434
|
+
static createSponsorInvitationReward<T>(token: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6435
|
+
/** Update sponsor-owned reward content and eligibility. */
|
|
6436
|
+
static updateSponsorInvitationReward<T>(token: string, reward_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6437
|
+
/** Remove a sponsor-owned draft reward. */
|
|
6438
|
+
static deleteSponsorInvitationReward<T>(token: string, reward_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6405
6439
|
}
|
|
6406
6440
|
|
|
6407
6441
|
declare class Newsletters {
|
|
@@ -6932,6 +6966,95 @@ declare class Media {
|
|
|
6932
6966
|
static process<T>(media_id: string, data: VideoProcessRequest): AxiosPromise<Response<T>>;
|
|
6933
6967
|
}
|
|
6934
6968
|
|
|
6969
|
+
type DiscordMediaType = 'all' | 'image' | 'video' | 'gif';
|
|
6970
|
+
type DiscordMediaAuthorType = 'all' | 'user' | 'bot' | 'webhook';
|
|
6971
|
+
interface DiscordMediaSearchParams {
|
|
6972
|
+
cursor?: string;
|
|
6973
|
+
channel_id?: string;
|
|
6974
|
+
search?: string;
|
|
6975
|
+
search_scope?: 'content' | 'filename';
|
|
6976
|
+
media_type?: DiscordMediaType;
|
|
6977
|
+
author_type?: DiscordMediaAuthorType;
|
|
6978
|
+
date_from?: string;
|
|
6979
|
+
date_to?: string;
|
|
6980
|
+
sort_order?: 'asc' | 'desc';
|
|
6981
|
+
include_imported?: boolean;
|
|
6982
|
+
include_unsupported?: boolean;
|
|
6983
|
+
include_nsfw?: boolean;
|
|
6984
|
+
}
|
|
6985
|
+
interface DiscordMediaAttachment {
|
|
6986
|
+
id: string;
|
|
6987
|
+
filename: string;
|
|
6988
|
+
title?: string | null;
|
|
6989
|
+
description?: string | null;
|
|
6990
|
+
mime_type: string;
|
|
6991
|
+
media_type: 'image' | 'video';
|
|
6992
|
+
size: number;
|
|
6993
|
+
url?: string | null;
|
|
6994
|
+
proxy_url?: string | null;
|
|
6995
|
+
width?: number | null;
|
|
6996
|
+
height?: number | null;
|
|
6997
|
+
duration_secs?: number | null;
|
|
6998
|
+
supported: boolean;
|
|
6999
|
+
unsupported_reason?: string | null;
|
|
7000
|
+
already_imported: boolean;
|
|
7001
|
+
imported_title_update_id?: string | null;
|
|
7002
|
+
imported_media_id?: string | null;
|
|
7003
|
+
duplicate_import: boolean;
|
|
7004
|
+
}
|
|
7005
|
+
interface DiscordMediaMessage {
|
|
7006
|
+
id: string;
|
|
7007
|
+
channel_id: string;
|
|
7008
|
+
content: string;
|
|
7009
|
+
timestamp?: string | null;
|
|
7010
|
+
edited_timestamp?: string | null;
|
|
7011
|
+
jump_url: string;
|
|
7012
|
+
author: {
|
|
7013
|
+
id?: string | null;
|
|
7014
|
+
username: string;
|
|
7015
|
+
avatar?: string | null;
|
|
7016
|
+
bot: boolean;
|
|
7017
|
+
};
|
|
7018
|
+
webhook_id?: string | null;
|
|
7019
|
+
attachments: DiscordMediaAttachment[];
|
|
7020
|
+
}
|
|
7021
|
+
interface DiscordMediaSearchResponse {
|
|
7022
|
+
items: DiscordMediaMessage[];
|
|
7023
|
+
total_results: number;
|
|
7024
|
+
next_cursor?: string | null;
|
|
7025
|
+
indexing: boolean;
|
|
7026
|
+
retry_after?: number | null;
|
|
7027
|
+
}
|
|
7028
|
+
interface DiscordMediaImportGroup {
|
|
7029
|
+
channel_id: string;
|
|
7030
|
+
message_id: string;
|
|
7031
|
+
attachment_ids: string[];
|
|
7032
|
+
}
|
|
7033
|
+
interface DiscordMediaImportRequest {
|
|
7034
|
+
groups: DiscordMediaImportGroup[];
|
|
7035
|
+
}
|
|
7036
|
+
interface DiscordMediaImportAttachmentResult {
|
|
7037
|
+
status: 'imported' | 'duplicate' | 'failed';
|
|
7038
|
+
channel_id: string;
|
|
7039
|
+
message_id: string;
|
|
7040
|
+
attachment_id: string;
|
|
7041
|
+
media_id?: string;
|
|
7042
|
+
title_update_id?: string;
|
|
7043
|
+
reason?: string;
|
|
7044
|
+
}
|
|
7045
|
+
interface DiscordMediaImportResponse {
|
|
7046
|
+
imported_count: number;
|
|
7047
|
+
duplicate_count: number;
|
|
7048
|
+
failed_count: number;
|
|
7049
|
+
updates: Array<{
|
|
7050
|
+
id: string;
|
|
7051
|
+
title?: string | null;
|
|
7052
|
+
scheduled_status: 'pending';
|
|
7053
|
+
schedule_for_social: false;
|
|
7054
|
+
media_count: number;
|
|
7055
|
+
}>;
|
|
7056
|
+
attachments: DiscordMediaImportAttachmentResult[];
|
|
7057
|
+
}
|
|
6935
7058
|
declare class Scheduler {
|
|
6936
7059
|
/**
|
|
6937
7060
|
* List promotion schedules.
|
|
@@ -7242,6 +7365,17 @@ declare class Scheduler {
|
|
|
7242
7365
|
* @returns promise
|
|
7243
7366
|
*/
|
|
7244
7367
|
static getDiscordChannels<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7368
|
+
/**
|
|
7369
|
+
* Search image and video attachments in the connected Discord server.
|
|
7370
|
+
* This call only returns remote candidates; it does not copy files into the
|
|
7371
|
+
* Library and does not create or schedule social posts.
|
|
7372
|
+
*/
|
|
7373
|
+
static searchDiscordMedia<T = DiscordMediaSearchResponse>(scheduler_id: string, params?: DiscordMediaSearchParams): AxiosPromise<Response<T>>;
|
|
7374
|
+
/**
|
|
7375
|
+
* Import explicitly selected Discord attachments as pending, unscheduled
|
|
7376
|
+
* Library updates. Attachments selected from one message stay grouped.
|
|
7377
|
+
*/
|
|
7378
|
+
static importDiscordMedia<T = DiscordMediaImportResponse>(scheduler_id: string, data: DiscordMediaImportRequest, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
7245
7379
|
/**
|
|
7246
7380
|
* Clear Google Ads OAuth credentials from a promotion schedule.
|
|
7247
7381
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glitch-javascript-sdk",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"description": "Javascript SDK for Glitch",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"types": "dist/index.d.ts",
|
|
15
15
|
"scripts": {
|
|
16
|
-
"test": "node scripts/test-game-advertising-routes.cjs",
|
|
16
|
+
"test": "node scripts/test-game-advertising-routes.cjs && node scripts/test-discord-media-routes.cjs",
|
|
17
17
|
"build": "rm -Rf dist && rollup -c --bundleConfigAsCjs",
|
|
18
18
|
"build-docs": "rm -rf docs && typedoc --tsconfig tsconfig.json src/"
|
|
19
19
|
},
|
package/src/api/GameShows.ts
CHANGED
|
@@ -348,6 +348,66 @@ class GameShows {
|
|
|
348
348
|
return Requests.processRoute(GameShowsRoute.routes.listWishlist, {}, { show_id: show_id }, params);
|
|
349
349
|
}
|
|
350
350
|
|
|
351
|
+
/** List the anonymous, published festival award/prize/swag catalog. */
|
|
352
|
+
public static listPublicRewards<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
353
|
+
return Requests.processRoute(GameShowsRoute.routes.listPublicRewards, {}, { show_id }, params);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/** Retrieve one SSR-ready public festival reward. */
|
|
357
|
+
public static getPublicReward<T>(show_id: string, reward_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
358
|
+
return Requests.processRoute(GameShowsRoute.routes.getPublicReward, {}, { show_id, reward_id }, params);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/** Retrieve a privacy-safe public game leaderboard for one reward. */
|
|
362
|
+
public static getPublicRewardLeaderboard<T>(show_id: string, reward_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
363
|
+
return Requests.processRoute(GameShowsRoute.routes.getPublicRewardLeaderboard, {}, { show_id, reward_id }, params);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/** List drafts, sponsor items, inventory, recipients, and fulfillment for organizers. */
|
|
367
|
+
public static manageRewards<T>(show_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
368
|
+
return Requests.processRoute(GameShowsRoute.routes.manageRewards, {}, { show_id }, params);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/** Claim an eligible attendee, entrant, points, or previously awarded festival reward. */
|
|
372
|
+
public static claimReward<T>(show_id: string, reward_id: string, data: { title_id?: string } = {}, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
373
|
+
return Requests.processRoute(GameShowsRoute.routes.claimReward, data, { show_id, reward_id }, params);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/** Create an organizer-controlled festival award, prize, swag item, or reward. */
|
|
377
|
+
public static createReward<T>(show_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
378
|
+
return Requests.processRoute(GameShowsRoute.routes.createReward, data, { show_id }, params);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/** Update publication, eligibility, metrics, inventory, or rich content. */
|
|
382
|
+
public static updateReward<T>(show_id: string, reward_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
383
|
+
return Requests.processRoute(GameShowsRoute.routes.updateReward, data, { show_id, reward_id }, params);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/** Soft-delete one festival reward. */
|
|
387
|
+
public static deleteReward<T>(show_id: string, reward_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
388
|
+
return Requests.processRoute(GameShowsRoute.routes.deleteReward, {}, { show_id, reward_id }, params);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/** Preview the organizer-only game or attendee performance leaderboard. */
|
|
392
|
+
public static rewardLeaderboard<T>(show_id: string, reward_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
393
|
+
return Requests.processRoute(GameShowsRoute.routes.rewardLeaderboard, {}, { show_id, reward_id }, params);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/** Snapshot current metric leaders as reward recipients. */
|
|
397
|
+
public static autoAwardReward<T>(show_id: string, reward_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
398
|
+
return Requests.processRoute(GameShowsRoute.routes.autoAwardReward, {}, { show_id, reward_id }, params);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/** Add a manual nominee, winner, honoree, claimant, or fulfillment record. */
|
|
402
|
+
public static addRewardRecipient<T>(show_id: string, reward_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
403
|
+
return Requests.processRoute(GameShowsRoute.routes.addRewardRecipient, data, { show_id, reward_id }, params);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/** Update judging, claim, revocation, rank, or fulfillment state. */
|
|
407
|
+
public static updateRewardRecipient<T>(show_id: string, reward_id: string, recipient_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
408
|
+
return Requests.processRoute(GameShowsRoute.routes.updateRewardRecipient, data, { show_id, reward_id, recipient_id }, params);
|
|
409
|
+
}
|
|
410
|
+
|
|
351
411
|
/**
|
|
352
412
|
* List public game shows that include a title. Useful for game-page festival banners.
|
|
353
413
|
*/
|
|
@@ -457,6 +517,26 @@ class GameShows {
|
|
|
457
517
|
return Requests.processRoute(GameShowsRoute.routes.sponsorInvitationConfirmPayment, {}, { token }, params);
|
|
458
518
|
}
|
|
459
519
|
|
|
520
|
+
/** List awards, prizes, and swag owned by a sponsor invitation. */
|
|
521
|
+
public static sponsorInvitationRewards<T>(token: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
522
|
+
return Requests.processRoute(GameShowsRoute.routes.sponsorInvitationRewards, {}, { token }, params);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/** Create a draft sponsor-owned award, prize, or swag item. */
|
|
526
|
+
public static createSponsorInvitationReward<T>(token: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
527
|
+
return Requests.processRoute(GameShowsRoute.routes.sponsorInvitationCreateReward, data, { token }, params);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
/** Update sponsor-owned reward content and eligibility. */
|
|
531
|
+
public static updateSponsorInvitationReward<T>(token: string, reward_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
532
|
+
return Requests.processRoute(GameShowsRoute.routes.sponsorInvitationUpdateReward, data, { token, reward_id }, params);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/** Remove a sponsor-owned draft reward. */
|
|
536
|
+
public static deleteSponsorInvitationReward<T>(token: string, reward_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
537
|
+
return Requests.processRoute(GameShowsRoute.routes.sponsorInvitationDeleteReward, {}, { token, reward_id }, params);
|
|
538
|
+
}
|
|
539
|
+
|
|
460
540
|
}
|
|
461
541
|
|
|
462
542
|
export default GameShows;
|
package/src/api/Scheduler.ts
CHANGED
|
@@ -3,6 +3,104 @@ import Requests from "../util/Requests";
|
|
|
3
3
|
import Response from "../util/Response";
|
|
4
4
|
import { AxiosPromise } from "axios";
|
|
5
5
|
|
|
6
|
+
export type DiscordMediaType = 'all' | 'image' | 'video' | 'gif';
|
|
7
|
+
export type DiscordMediaAuthorType = 'all' | 'user' | 'bot' | 'webhook';
|
|
8
|
+
|
|
9
|
+
export interface DiscordMediaSearchParams {
|
|
10
|
+
cursor?: string;
|
|
11
|
+
channel_id?: string;
|
|
12
|
+
search?: string;
|
|
13
|
+
search_scope?: 'content' | 'filename';
|
|
14
|
+
media_type?: DiscordMediaType;
|
|
15
|
+
author_type?: DiscordMediaAuthorType;
|
|
16
|
+
date_from?: string;
|
|
17
|
+
date_to?: string;
|
|
18
|
+
sort_order?: 'asc' | 'desc';
|
|
19
|
+
include_imported?: boolean;
|
|
20
|
+
include_unsupported?: boolean;
|
|
21
|
+
include_nsfw?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface DiscordMediaAttachment {
|
|
25
|
+
id: string;
|
|
26
|
+
filename: string;
|
|
27
|
+
title?: string | null;
|
|
28
|
+
description?: string | null;
|
|
29
|
+
mime_type: string;
|
|
30
|
+
media_type: 'image' | 'video';
|
|
31
|
+
size: number;
|
|
32
|
+
url?: string | null;
|
|
33
|
+
proxy_url?: string | null;
|
|
34
|
+
width?: number | null;
|
|
35
|
+
height?: number | null;
|
|
36
|
+
duration_secs?: number | null;
|
|
37
|
+
supported: boolean;
|
|
38
|
+
unsupported_reason?: string | null;
|
|
39
|
+
already_imported: boolean;
|
|
40
|
+
imported_title_update_id?: string | null;
|
|
41
|
+
imported_media_id?: string | null;
|
|
42
|
+
duplicate_import: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface DiscordMediaMessage {
|
|
46
|
+
id: string;
|
|
47
|
+
channel_id: string;
|
|
48
|
+
content: string;
|
|
49
|
+
timestamp?: string | null;
|
|
50
|
+
edited_timestamp?: string | null;
|
|
51
|
+
jump_url: string;
|
|
52
|
+
author: {
|
|
53
|
+
id?: string | null;
|
|
54
|
+
username: string;
|
|
55
|
+
avatar?: string | null;
|
|
56
|
+
bot: boolean;
|
|
57
|
+
};
|
|
58
|
+
webhook_id?: string | null;
|
|
59
|
+
attachments: DiscordMediaAttachment[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface DiscordMediaSearchResponse {
|
|
63
|
+
items: DiscordMediaMessage[];
|
|
64
|
+
total_results: number;
|
|
65
|
+
next_cursor?: string | null;
|
|
66
|
+
indexing: boolean;
|
|
67
|
+
retry_after?: number | null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface DiscordMediaImportGroup {
|
|
71
|
+
channel_id: string;
|
|
72
|
+
message_id: string;
|
|
73
|
+
attachment_ids: string[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface DiscordMediaImportRequest {
|
|
77
|
+
groups: DiscordMediaImportGroup[];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface DiscordMediaImportAttachmentResult {
|
|
81
|
+
status: 'imported' | 'duplicate' | 'failed';
|
|
82
|
+
channel_id: string;
|
|
83
|
+
message_id: string;
|
|
84
|
+
attachment_id: string;
|
|
85
|
+
media_id?: string;
|
|
86
|
+
title_update_id?: string;
|
|
87
|
+
reason?: string;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface DiscordMediaImportResponse {
|
|
91
|
+
imported_count: number;
|
|
92
|
+
duplicate_count: number;
|
|
93
|
+
failed_count: number;
|
|
94
|
+
updates: Array<{
|
|
95
|
+
id: string;
|
|
96
|
+
title?: string | null;
|
|
97
|
+
scheduled_status: 'pending';
|
|
98
|
+
schedule_for_social: false;
|
|
99
|
+
media_count: number;
|
|
100
|
+
}>;
|
|
101
|
+
attachments: DiscordMediaImportAttachmentResult[];
|
|
102
|
+
}
|
|
103
|
+
|
|
6
104
|
class Scheduler {
|
|
7
105
|
/**
|
|
8
106
|
* List promotion schedules.
|
|
@@ -431,6 +529,30 @@ class Scheduler {
|
|
|
431
529
|
return Requests.processRoute(SchedulerRoute.routes.getDiscordChannels, {}, { scheduler_id }, params);
|
|
432
530
|
}
|
|
433
531
|
|
|
532
|
+
/**
|
|
533
|
+
* Search image and video attachments in the connected Discord server.
|
|
534
|
+
* This call only returns remote candidates; it does not copy files into the
|
|
535
|
+
* Library and does not create or schedule social posts.
|
|
536
|
+
*/
|
|
537
|
+
public static searchDiscordMedia<T = DiscordMediaSearchResponse>(
|
|
538
|
+
scheduler_id: string,
|
|
539
|
+
params?: DiscordMediaSearchParams
|
|
540
|
+
): AxiosPromise<Response<T>> {
|
|
541
|
+
return Requests.processRoute(SchedulerRoute.routes.searchDiscordMedia, {}, { scheduler_id }, params);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Import explicitly selected Discord attachments as pending, unscheduled
|
|
546
|
+
* Library updates. Attachments selected from one message stay grouped.
|
|
547
|
+
*/
|
|
548
|
+
public static importDiscordMedia<T = DiscordMediaImportResponse>(
|
|
549
|
+
scheduler_id: string,
|
|
550
|
+
data: DiscordMediaImportRequest,
|
|
551
|
+
params?: Record<string, any>
|
|
552
|
+
): AxiosPromise<Response<T>> {
|
|
553
|
+
return Requests.processRoute(SchedulerRoute.routes.importDiscordMedia, data, { scheduler_id }, params);
|
|
554
|
+
}
|
|
555
|
+
|
|
434
556
|
/**
|
|
435
557
|
* Clear Google Ads OAuth credentials from a promotion schedule.
|
|
436
558
|
*
|
|
@@ -53,6 +53,19 @@ class GameShowsRoute {
|
|
|
53
53
|
joinWishlist: { url: '/gameshows/{show_id}/wishlist', method: HTTP_METHODS.POST },
|
|
54
54
|
confirmWishlist: { url: '/gameshows/wishlist/confirm/{token}', method: HTTP_METHODS.GET },
|
|
55
55
|
listWishlist: { url: '/gameshows/{show_id}/wishlist', method: HTTP_METHODS.GET },
|
|
56
|
+
// Festival awards, prizes, swag, metric leaderboards, and recipients.
|
|
57
|
+
listPublicRewards: { url: '/gameshows/{show_id}/rewards', method: HTTP_METHODS.GET },
|
|
58
|
+
getPublicReward: { url: '/gameshows/{show_id}/rewards/{reward_id}', method: HTTP_METHODS.GET },
|
|
59
|
+
getPublicRewardLeaderboard: { url: '/gameshows/{show_id}/rewards/{reward_id}/leaderboard/public', method: HTTP_METHODS.GET },
|
|
60
|
+
manageRewards: { url: '/gameshows/{show_id}/rewards/manage', method: HTTP_METHODS.GET },
|
|
61
|
+
claimReward: { url: '/gameshows/{show_id}/rewards/{reward_id}/claim', method: HTTP_METHODS.POST },
|
|
62
|
+
createReward: { url: '/gameshows/{show_id}/rewards', method: HTTP_METHODS.POST },
|
|
63
|
+
updateReward: { url: '/gameshows/{show_id}/rewards/{reward_id}', method: HTTP_METHODS.PUT },
|
|
64
|
+
deleteReward: { url: '/gameshows/{show_id}/rewards/{reward_id}', method: HTTP_METHODS.DELETE },
|
|
65
|
+
rewardLeaderboard: { url: '/gameshows/{show_id}/rewards/{reward_id}/leaderboard', method: HTTP_METHODS.GET },
|
|
66
|
+
autoAwardReward: { url: '/gameshows/{show_id}/rewards/{reward_id}/auto-award', method: HTTP_METHODS.POST },
|
|
67
|
+
addRewardRecipient: { url: '/gameshows/{show_id}/rewards/{reward_id}/recipients', method: HTTP_METHODS.POST },
|
|
68
|
+
updateRewardRecipient: { url: '/gameshows/{show_id}/rewards/{reward_id}/recipients/{recipient_id}', method: HTTP_METHODS.PUT },
|
|
56
69
|
listForTitle: { url: '/titles/{title_id}/gameshows', method: HTTP_METHODS.GET },
|
|
57
70
|
// Organizer sponsor lifecycle and placement administration.
|
|
58
71
|
listSponsors: { url: '/gameshows/{show_id}/sponsors', method: HTTP_METHODS.GET },
|
|
@@ -72,6 +85,10 @@ class GameShowsRoute {
|
|
|
72
85
|
sponsorInvitationSubmit: { url: '/gameshow-sponsor-invitations/{token}/submit', method: HTTP_METHODS.POST },
|
|
73
86
|
sponsorInvitationPayment: { url: '/gameshow-sponsor-invitations/{token}/payment', method: HTTP_METHODS.POST },
|
|
74
87
|
sponsorInvitationConfirmPayment: { url: '/gameshow-sponsor-invitations/{token}/payment/confirm', method: HTTP_METHODS.POST },
|
|
88
|
+
sponsorInvitationRewards: { url: '/gameshow-sponsor-invitations/{token}/rewards', method: HTTP_METHODS.GET },
|
|
89
|
+
sponsorInvitationCreateReward: { url: '/gameshow-sponsor-invitations/{token}/rewards', method: HTTP_METHODS.POST },
|
|
90
|
+
sponsorInvitationUpdateReward: { url: '/gameshow-sponsor-invitations/{token}/rewards/{reward_id}', method: HTTP_METHODS.PUT },
|
|
91
|
+
sponsorInvitationDeleteReward: { url: '/gameshow-sponsor-invitations/{token}/rewards/{reward_id}', method: HTTP_METHODS.DELETE },
|
|
75
92
|
};
|
|
76
93
|
|
|
77
94
|
}
|
|
@@ -50,6 +50,8 @@ class SchedulerRoute {
|
|
|
50
50
|
getRedditSubredditFlairs: { url: '/schedulers/{scheduler_id}/reddit/subreddits/{subreddit}/flairs', method: HTTP_METHODS.GET },
|
|
51
51
|
getRedditSubredditRules: { url: '/schedulers/{scheduler_id}/reddit/subreddits/{subreddit}/rules', method: HTTP_METHODS.GET },
|
|
52
52
|
getDiscordChannels: { url: '/schedulers/{scheduler_id}/discord/channels', method: HTTP_METHODS.GET },
|
|
53
|
+
searchDiscordMedia: { url: '/schedulers/{scheduler_id}/discord/media', method: HTTP_METHODS.GET },
|
|
54
|
+
importDiscordMedia: { url: '/schedulers/{scheduler_id}/discord/media/import', method: HTTP_METHODS.POST },
|
|
53
55
|
|
|
54
56
|
crossPromoteListRelationships: {
|
|
55
57
|
url: '/schedulers/{scheduler_id}/crosspromote/relationships',
|