glitch-javascript-sdk 3.6.0 → 3.8.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.
@@ -1,5 +1,9 @@
1
1
  import Route from './interface';
2
2
  declare class GameAdvertisingRoute {
3
+ /**
4
+ * Route templates for publisher game-ad inventory, telemetry, earnings, and
5
+ * site administration. Placeholders are expanded by Requests.processRoute.
6
+ */
3
7
  static routes: {
4
8
  [key: string]: Route;
5
9
  };
package/dist/index.d.ts CHANGED
@@ -1893,6 +1893,50 @@ declare class Communities {
1893
1893
  static saveInfluencerToPool<T>(community_id: string, data: object): AxiosPromise<Response<T>>;
1894
1894
  }
1895
1895
 
1896
+ /** Human-readable earning categories returned by influencer payout APIs. */
1897
+ type InfluencerPayoutSourceType = "campaign_compensation" | "ad_revenue_share" | "subscription_residual" | "manual_adjustment";
1898
+ /** Auditable metrics and creator-content attribution attached to a payout. */
1899
+ interface InfluencerPayoutBreakdown {
1900
+ label?: string;
1901
+ payment_method?: "flat" | "performance" | "hybrid";
1902
+ provider?: string;
1903
+ period_start?: string;
1904
+ period_end?: string;
1905
+ impressions?: number;
1906
+ clicks?: number;
1907
+ short_link_id?: string | null;
1908
+ short_link_click_id?: string | null;
1909
+ social_media_post_id?: string | null;
1910
+ tracking_link_label?: string | null;
1911
+ social_platform?: string | null;
1912
+ social_post_url?: string | null;
1913
+ }
1914
+ /** One campaign or advertising earning payable to the authenticated influencer. */
1915
+ interface InfluencerPayout {
1916
+ id: string;
1917
+ user_id: string;
1918
+ campaign_id: string;
1919
+ amount: number;
1920
+ currency: string;
1921
+ status: "pending" | "completed" | "failed";
1922
+ payout_date?: string | null;
1923
+ source_type: InfluencerPayoutSourceType;
1924
+ source_label: string;
1925
+ source_reference_id?: string | null;
1926
+ breakdown?: InfluencerPayoutBreakdown;
1927
+ campaign?: Record<string, any>;
1928
+ }
1929
+ /** Optional filters for the authenticated influencer's payout history. */
1930
+ interface InfluencerPayoutQuery {
1931
+ campaign_id?: string;
1932
+ month?: number;
1933
+ year?: number;
1934
+ amount?: number;
1935
+ status?: "pending" | "completed" | "failed";
1936
+ source_type?: InfluencerPayoutSourceType;
1937
+ orderBy?: "created_at" | "amount";
1938
+ orderDirection?: "asc" | "desc";
1939
+ }
1896
1940
  declare class Users {
1897
1941
  /**
1898
1942
  * List all the users.
@@ -1935,16 +1979,17 @@ declare class Users {
1935
1979
  */
1936
1980
  static getCampaignInvites<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
1937
1981
  /**
1938
- * Gets payouts from past campaings
1982
+ * Gets the authenticated influencer's payouts from campaigns and attributed
1983
+ * game advertising. Advertising revenue is returned as a separate additive
1984
+ * source with provider-period metrics and tracking-link/social-post IDs.
1939
1985
  *
1940
1986
  * @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
1941
1987
  *
1942
- * @param user_id The id of the user to update.
1943
- * @param data The data to update.
1988
+ * @param params Optional campaign, date, status, source, and ordering filters.
1944
1989
  *
1945
1990
  * @returns promise
1946
1991
  */
1947
- static getPayouts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
1992
+ static getPayouts<T = InfluencerPayout[]>(params?: InfluencerPayoutQuery): AxiosPromise<Response<T>>;
1948
1993
  /**
1949
1994
  * Sync the current influencer's information.
1950
1995
  *
@@ -6306,6 +6351,32 @@ declare class GameShows {
6306
6351
  * List notification signups for a game show. Requires organizer permissions.
6307
6352
  */
6308
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>>;
6309
6380
  /**
6310
6381
  * List public game shows that include a title. Useful for game-page festival banners.
6311
6382
  */
@@ -6357,6 +6428,14 @@ declare class GameShows {
6357
6428
  static paySponsorInvitation<T>(token: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
6358
6429
  /** Synchronize the same intent after Stripe.js completes required 3DS. */
6359
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>>;
6360
6439
  }
6361
6440
 
6362
6441
  declare class Newsletters {
@@ -11028,25 +11107,89 @@ declare class MarketResearch {
11028
11107
  }
11029
11108
 
11030
11109
  interface GameAdEventPayload {
11110
+ /** Opaque token returned by the server-created advertising manifest. */
11031
11111
  token: string;
11112
+ /** Client idempotency UUID. Reuse is valid only within the same ad session. */
11032
11113
  event_uuid?: string;
11114
+ /** Provider that produced or attempted the event. */
11033
11115
  provider: string;
11116
+ /** Stable Glitch placement name, such as game_banner or game_video. */
11034
11117
  placement: string;
11035
- format: 'banner' | 'video' | 'interstitial' | 'rewarded' | 'other';
11036
- event_type: 'sdk_ready' | 'request_started' | 'loaded' | 'no_fill' | 'started' | 'impression' | 'viewable' | 'clicked' | 'completed' | 'skipped' | 'closed' | 'paused_game' | 'resumed_game' | 'error';
11118
+ /** Normalized creative/ad format. */
11119
+ format: 'banner' | 'video' | 'interstitial' | 'rewarded' | 'in_game_image' | 'in_game_video' | 'other';
11120
+ /** Normalized SDK/ad lifecycle event. */
11121
+ event_type: 'sdk_ready' | 'request_started' | 'loaded' | 'channel_registered' | 'measurement' | 'no_fill' | 'fallback_shown' | 'started' | 'impression' | 'viewable' | 'clicked' | 'completed' | 'skipped' | 'closed' | 'paused_game' | 'resumed_game' | 'error';
11122
+ /** Optional provider-native event or impression identifier. */
11037
11123
  provider_event_id?: string;
11124
+ /** Non-sensitive provider diagnostics and event context. */
11038
11125
  metadata?: Record<string, any>;
11126
+ /** ISO 8601 client-observed timestamp. Defaults to server receipt time. */
11039
11127
  occurred_at?: string;
11040
11128
  }
11129
+ /** Provider-neutral intrinsic-ad surface declared by a game developer. */
11130
+ interface GameInGameAdPlacement {
11131
+ id?: string;
11132
+ title_id?: string;
11133
+ provider?: 'anzu';
11134
+ placement_key: string;
11135
+ channel_name: string;
11136
+ surface_type: 'mesh' | 'sprite' | 'ui_image' | 'raw_image' | 'html' | 'electron_shell';
11137
+ scene_name?: string | null;
11138
+ aspect_ratio: number;
11139
+ allow_images: boolean;
11140
+ allow_videos: boolean;
11141
+ allow_audio?: boolean;
11142
+ is_dynamic: boolean;
11143
+ is_clickable: boolean;
11144
+ shrink_to_fit: boolean;
11145
+ fallback_media_url?: string | null;
11146
+ status: 'active' | 'disabled';
11147
+ metadata?: Record<string, any> | null;
11148
+ }
11149
+ /** Public delivery identity for a provider and runtime platform. */
11150
+ interface GameAdProviderApp {
11151
+ id?: string;
11152
+ title_id?: string | null;
11153
+ provider: 'anzu';
11154
+ platform: 'web' | 'electron_macos' | 'electron_windows' | 'electron_linux' | 'unity_webgl' | 'cocos_web' | 'construct_web';
11155
+ app_key: string;
11156
+ bundle_id?: string | null;
11157
+ mode: 'integration' | 'production';
11158
+ integration_type: 'managed' | 'direct';
11159
+ status: 'active' | 'disabled' | 'pending';
11160
+ metadata?: Record<string, any> | null;
11161
+ }
11162
+ /**
11163
+ * Typed client for platform-served game advertising.
11164
+ *
11165
+ * These endpoints manage publisher inventory displayed around playable games;
11166
+ * they are intentionally separate from APIs used to buy advertising campaigns.
11167
+ */
11041
11168
  declare class GameAdvertising {
11169
+ /** Return developer-visible ad-earnings settings for a title. */
11042
11170
  static settings<T>(title_id: string): AxiosPromise<Response<T>>;
11171
+ /** Update developer ad-earnings activation and optional title provider ID. */
11043
11172
  static updateSettings<T>(title_id: string, data: object): AxiosPromise<Response<T>>;
11173
+ /** Resolve ad eligibility and create an expiring provider manifest/session. */
11044
11174
  static createSession<T>(title_id: string, data: object): AxiosPromise<Response<T>>;
11175
+ /** Store one normalized, idempotent event for an advertising session. */
11045
11176
  static storeEvent<T>(title_id: string, session_id: string, data: GameAdEventPayload): AxiosPromise<Response<T>>;
11177
+ /** Return developer-visible estimated/finalized earnings and delivery totals. */
11046
11178
  static revenueSummary<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
11179
+ /** Return every intrinsic-ad surface configured for a title. */
11180
+ static inGamePlacements<T>(title_id: string): AxiosPromise<Response<T>>;
11181
+ /** Atomically replace a title's provider-neutral intrinsic-ad surfaces. */
11182
+ static replaceInGamePlacements<T>(title_id: string, placements: GameInGameAdPlacement[]): AxiosPromise<Response<T>>;
11183
+ /** Return site-admin delivery settings, aggregate metrics, and recent revenue. */
11047
11184
  static adminDashboard<T>(): AxiosPromise<Response<T>>;
11185
+ /** Partially update platform-wide providers and delivery frequency. */
11048
11186
  static adminUpdateSettings<T>(data: object): AxiosPromise<Response<T>>;
11187
+ /** Import or reconcile one provider revenue report row. */
11049
11188
  static adminStoreRevenue<T>(data: object): AxiosPromise<Response<T>>;
11189
+ /** Return public provider app keys and platform mappings for site admins. */
11190
+ static adminProviderApps<T>(): AxiosPromise<Response<T>>;
11191
+ /** Create or update a provider app mapping without accepting report secrets. */
11192
+ static adminUpsertProviderApp<T>(data: GameAdProviderApp): AxiosPromise<Response<T>>;
11050
11193
  }
11051
11194
 
11052
11195
  interface Route {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "3.6.0",
3
+ "version": "3.8.0",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -4,49 +4,127 @@ import Requests from '../util/Requests';
4
4
  import Response from '../util/Response';
5
5
 
6
6
  export interface GameAdEventPayload {
7
+ /** Opaque token returned by the server-created advertising manifest. */
7
8
  token: string;
9
+ /** Client idempotency UUID. Reuse is valid only within the same ad session. */
8
10
  event_uuid?: string;
11
+ /** Provider that produced or attempted the event. */
9
12
  provider: string;
13
+ /** Stable Glitch placement name, such as game_banner or game_video. */
10
14
  placement: string;
11
- format: 'banner' | 'video' | 'interstitial' | 'rewarded' | 'other';
12
- event_type: 'sdk_ready' | 'request_started' | 'loaded' | 'no_fill' | 'started' | 'impression' | 'viewable' | 'clicked' | 'completed' | 'skipped' | 'closed' | 'paused_game' | 'resumed_game' | 'error';
15
+ /** Normalized creative/ad format. */
16
+ format: 'banner' | 'video' | 'interstitial' | 'rewarded' | 'in_game_image' | 'in_game_video' | 'other';
17
+ /** Normalized SDK/ad lifecycle event. */
18
+ event_type: 'sdk_ready' | 'request_started' | 'loaded' | 'channel_registered' | 'measurement' | 'no_fill' | 'fallback_shown' | 'started' | 'impression' | 'viewable' | 'clicked' | 'completed' | 'skipped' | 'closed' | 'paused_game' | 'resumed_game' | 'error';
19
+ /** Optional provider-native event or impression identifier. */
13
20
  provider_event_id?: string;
21
+ /** Non-sensitive provider diagnostics and event context. */
14
22
  metadata?: Record<string, any>;
23
+ /** ISO 8601 client-observed timestamp. Defaults to server receipt time. */
15
24
  occurred_at?: string;
16
25
  }
17
26
 
27
+ /** Provider-neutral intrinsic-ad surface declared by a game developer. */
28
+ export interface GameInGameAdPlacement {
29
+ id?: string;
30
+ title_id?: string;
31
+ provider?: 'anzu';
32
+ placement_key: string;
33
+ channel_name: string;
34
+ surface_type: 'mesh' | 'sprite' | 'ui_image' | 'raw_image' | 'html' | 'electron_shell';
35
+ scene_name?: string | null;
36
+ aspect_ratio: number;
37
+ allow_images: boolean;
38
+ allow_videos: boolean;
39
+ allow_audio?: boolean;
40
+ is_dynamic: boolean;
41
+ is_clickable: boolean;
42
+ shrink_to_fit: boolean;
43
+ fallback_media_url?: string | null;
44
+ status: 'active' | 'disabled';
45
+ metadata?: Record<string, any> | null;
46
+ }
47
+
48
+ /** Public delivery identity for a provider and runtime platform. */
49
+ export interface GameAdProviderApp {
50
+ id?: string;
51
+ title_id?: string | null;
52
+ provider: 'anzu';
53
+ platform: 'web' | 'electron_macos' | 'electron_windows' | 'electron_linux' | 'unity_webgl' | 'cocos_web' | 'construct_web';
54
+ app_key: string;
55
+ bundle_id?: string | null;
56
+ mode: 'integration' | 'production';
57
+ integration_type: 'managed' | 'direct';
58
+ status: 'active' | 'disabled' | 'pending';
59
+ metadata?: Record<string, any> | null;
60
+ }
61
+
62
+ /**
63
+ * Typed client for platform-served game advertising.
64
+ *
65
+ * These endpoints manage publisher inventory displayed around playable games;
66
+ * they are intentionally separate from APIs used to buy advertising campaigns.
67
+ */
18
68
  class GameAdvertising {
69
+ /** Return developer-visible ad-earnings settings for a title. */
19
70
  public static settings<T>(title_id: string): AxiosPromise<Response<T>> {
20
71
  return Requests.processRoute(GameAdvertisingRoute.routes.settings, undefined, { title_id });
21
72
  }
22
73
 
74
+ /** Update developer ad-earnings activation and optional title provider ID. */
23
75
  public static updateSettings<T>(title_id: string, data: object): AxiosPromise<Response<T>> {
24
76
  return Requests.processRoute(GameAdvertisingRoute.routes.updateSettings, data, { title_id });
25
77
  }
26
78
 
79
+ /** Resolve ad eligibility and create an expiring provider manifest/session. */
27
80
  public static createSession<T>(title_id: string, data: object): AxiosPromise<Response<T>> {
28
81
  return Requests.processRoute(GameAdvertisingRoute.routes.createSession, data, { title_id });
29
82
  }
30
83
 
84
+ /** Store one normalized, idempotent event for an advertising session. */
31
85
  public static storeEvent<T>(title_id: string, session_id: string, data: GameAdEventPayload): AxiosPromise<Response<T>> {
32
86
  return Requests.processRoute(GameAdvertisingRoute.routes.storeEvent, data, { title_id, session_id });
33
87
  }
34
88
 
89
+ /** Return developer-visible estimated/finalized earnings and delivery totals. */
35
90
  public static revenueSummary<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
36
91
  return Requests.processRoute(GameAdvertisingRoute.routes.revenueSummary, undefined, { title_id }, params);
37
92
  }
38
93
 
94
+ /** Return every intrinsic-ad surface configured for a title. */
95
+ public static inGamePlacements<T>(title_id: string): AxiosPromise<Response<T>> {
96
+ return Requests.processRoute(GameAdvertisingRoute.routes.inGamePlacements, undefined, { title_id });
97
+ }
98
+
99
+ /** Atomically replace a title's provider-neutral intrinsic-ad surfaces. */
100
+ public static replaceInGamePlacements<T>(title_id: string, placements: GameInGameAdPlacement[]): AxiosPromise<Response<T>> {
101
+ return Requests.processRoute(GameAdvertisingRoute.routes.replaceInGamePlacements, { placements }, { title_id });
102
+ }
103
+
104
+ /** Return site-admin delivery settings, aggregate metrics, and recent revenue. */
39
105
  public static adminDashboard<T>(): AxiosPromise<Response<T>> {
40
106
  return Requests.processRoute(GameAdvertisingRoute.routes.adminDashboard);
41
107
  }
42
108
 
109
+ /** Partially update platform-wide providers and delivery frequency. */
43
110
  public static adminUpdateSettings<T>(data: object): AxiosPromise<Response<T>> {
44
111
  return Requests.processRoute(GameAdvertisingRoute.routes.adminUpdateSettings, data);
45
112
  }
46
113
 
114
+ /** Import or reconcile one provider revenue report row. */
47
115
  public static adminStoreRevenue<T>(data: object): AxiosPromise<Response<T>> {
48
116
  return Requests.processRoute(GameAdvertisingRoute.routes.adminStoreRevenue, data);
49
117
  }
118
+
119
+ /** Return public provider app keys and platform mappings for site admins. */
120
+ public static adminProviderApps<T>(): AxiosPromise<Response<T>> {
121
+ return Requests.processRoute(GameAdvertisingRoute.routes.adminProviderApps);
122
+ }
123
+
124
+ /** Create or update a provider app mapping without accepting report secrets. */
125
+ public static adminUpsertProviderApp<T>(data: GameAdProviderApp): AxiosPromise<Response<T>> {
126
+ return Requests.processRoute(GameAdvertisingRoute.routes.adminUpsertProviderApp, data);
127
+ }
50
128
  }
51
129
 
52
130
  export default GameAdvertising;
@@ -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/Users.ts CHANGED
@@ -4,6 +4,54 @@ import Requests from "../util/Requests";
4
4
  import Response from "../util/Response";
5
5
  import { AxiosPromise } from "axios";
6
6
 
7
+ /** Human-readable earning categories returned by influencer payout APIs. */
8
+ export type InfluencerPayoutSourceType = "campaign_compensation" | "ad_revenue_share" | "subscription_residual" | "manual_adjustment";
9
+
10
+ /** Auditable metrics and creator-content attribution attached to a payout. */
11
+ export interface InfluencerPayoutBreakdown {
12
+ label?: string;
13
+ payment_method?: "flat" | "performance" | "hybrid";
14
+ provider?: string;
15
+ period_start?: string;
16
+ period_end?: string;
17
+ impressions?: number;
18
+ clicks?: number;
19
+ short_link_id?: string | null;
20
+ short_link_click_id?: string | null;
21
+ social_media_post_id?: string | null;
22
+ tracking_link_label?: string | null;
23
+ social_platform?: string | null;
24
+ social_post_url?: string | null;
25
+ }
26
+
27
+ /** One campaign or advertising earning payable to the authenticated influencer. */
28
+ export interface InfluencerPayout {
29
+ id: string;
30
+ user_id: string;
31
+ campaign_id: string;
32
+ amount: number;
33
+ currency: string;
34
+ status: "pending" | "completed" | "failed";
35
+ payout_date?: string | null;
36
+ source_type: InfluencerPayoutSourceType;
37
+ source_label: string;
38
+ source_reference_id?: string | null;
39
+ breakdown?: InfluencerPayoutBreakdown;
40
+ campaign?: Record<string, any>;
41
+ }
42
+
43
+ /** Optional filters for the authenticated influencer's payout history. */
44
+ export interface InfluencerPayoutQuery {
45
+ campaign_id?: string;
46
+ month?: number;
47
+ year?: number;
48
+ amount?: number;
49
+ status?: "pending" | "completed" | "failed";
50
+ source_type?: InfluencerPayoutSourceType;
51
+ orderBy?: "created_at" | "amount";
52
+ orderDirection?: "asc" | "desc";
53
+ }
54
+
7
55
  class Users {
8
56
 
9
57
  /**
@@ -62,16 +110,17 @@ class Users {
62
110
  }
63
111
 
64
112
  /**
65
- * Gets payouts from past campaings
113
+ * Gets the authenticated influencer's payouts from campaigns and attributed
114
+ * game advertising. Advertising revenue is returned as a separate additive
115
+ * source with provider-period metrics and tracking-link/social-post IDs.
66
116
  *
67
117
  * @see https://api.glitch.fun/api/documentation#/Users%20Route/showMe
68
118
  *
69
- * @param user_id The id of the user to update.
70
- * @param data The data to update.
119
+ * @param params Optional campaign, date, status, source, and ordering filters.
71
120
  *
72
121
  * @returns promise
73
122
  */
74
- public static getPayouts<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
123
+ public static getPayouts<T = InfluencerPayout[]>(params?: InfluencerPayoutQuery): AxiosPromise<Response<T>> {
75
124
 
76
125
  return Requests.processRoute(UserRoutes.routes.getPayouts, {}, undefined, params);
77
126
  }
@@ -2,15 +2,23 @@ import Route from './interface';
2
2
  import HTTP_METHODS from '../constants/HttpMethods';
3
3
 
4
4
  class GameAdvertisingRoute {
5
+ /**
6
+ * Route templates for publisher game-ad inventory, telemetry, earnings, and
7
+ * site administration. Placeholders are expanded by Requests.processRoute.
8
+ */
5
9
  public static routes: { [key: string]: Route } = {
6
10
  settings: { url: '/titles/{title_id}/advertising/settings', method: HTTP_METHODS.GET },
7
11
  updateSettings: { url: '/titles/{title_id}/advertising/settings', method: HTTP_METHODS.PUT },
8
12
  createSession: { url: '/titles/{title_id}/advertising/sessions', method: HTTP_METHODS.POST },
9
13
  storeEvent: { url: '/titles/{title_id}/advertising/sessions/{session_id}/events', method: HTTP_METHODS.POST },
10
14
  revenueSummary: { url: '/titles/{title_id}/advertising/revenue-summary', method: HTTP_METHODS.GET },
15
+ inGamePlacements: { url: '/titles/{title_id}/advertising/in-game/placements', method: HTTP_METHODS.GET },
16
+ replaceInGamePlacements: { url: '/titles/{title_id}/advertising/in-game/placements', method: HTTP_METHODS.PUT },
11
17
  adminDashboard: { url: '/admin/game-advertising', method: HTTP_METHODS.GET },
12
18
  adminUpdateSettings: { url: '/admin/game-advertising/settings', method: HTTP_METHODS.PUT },
13
19
  adminStoreRevenue: { url: '/admin/game-advertising/revenue', method: HTTP_METHODS.POST },
20
+ adminProviderApps: { url: '/admin/game-advertising/provider-apps', method: HTTP_METHODS.GET },
21
+ adminUpsertProviderApp: { url: '/admin/game-advertising/provider-apps', method: HTTP_METHODS.PUT },
14
22
  };
15
23
  }
16
24
 
@@ -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
  }