glitch-javascript-sdk 2.5.0 → 2.5.2

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,7 @@
1
+ import Route from "./interface";
2
+ declare class DiscordMarketplaceRoute {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default DiscordMarketplaceRoute;
package/dist/index.d.ts CHANGED
@@ -6963,92 +6963,158 @@ declare class TwitchReporting {
6963
6963
 
6964
6964
  declare class Raffles {
6965
6965
  /**
6966
- * List all raffles.
6967
- * @param params Filter by title_id, community_id, or status.
6966
+ * List all raffles with optional filters.
6968
6967
  */
6969
6968
  static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
6970
6969
  /**
6971
- * Create a new raffle for a specific title.
6970
+ * Create a new raffle (Game Owner).
6972
6971
  */
6973
6972
  static create<T>(data: object): AxiosPromise<Response<T>>;
6974
6973
  /**
6975
- * Get full details of a raffle.
6974
+ * Retrieve details for a specific raffle.
6976
6975
  */
6977
- static view<T>(raffle_id: string): AxiosPromise<Response<T>>;
6976
+ static view<T>(id: string): AxiosPromise<Response<T>>;
6978
6977
  /**
6979
- * Update raffle settings (Draft/Active status, dates, etc).
6978
+ * Enter a raffle (User/Player). Requires Steam ID.
6980
6979
  */
6981
- static update<T>(raffle_id: string, data: object): AxiosPromise<Response<T>>;
6980
+ static enter<T>(id: string, data: {
6981
+ referral_code?: string;
6982
+ device_fingerprint?: string;
6983
+ opt_in_playtesting?: boolean;
6984
+ }): AxiosPromise<Response<T>>;
6982
6985
  /**
6983
- * Delete a raffle.
6986
+ * Get the authenticated user's entry status for a specific raffle.
6984
6987
  */
6985
- static delete<T>(raffle_id: string): AxiosPromise<Response<T>>;
6988
+ static me<T>(id: string): AxiosPromise<Response<T>>;
6986
6989
  /**
6987
- * Enter the authenticated user into the raffle.
6988
- * @param data { referral_code?, device_fingerprint? }
6990
+ * Record a viral action (e.g., Steam Wishlist, Social Share).
6989
6991
  */
6990
- static enter<T>(raffle_id: string, data?: object): AxiosPromise<Response<T>>;
6992
+ static performAction<T>(id: string, data: {
6993
+ action_type: string;
6994
+ platform?: string;
6995
+ reference_id?: string;
6996
+ }): AxiosPromise<Response<T>>;
6991
6997
  /**
6992
- * Record a viral action (Steam Wishlist, Social Share) to earn more tickets.
6993
- * @param data { action_type: 'steam_wishlist'|'social_share', platform?, reference_id? }
6998
+ * Post raffle content to social media via Glitch API.
6994
6999
  */
6995
- static performAction<T>(raffle_id: string, data: object): AxiosPromise<Response<T>>;
7000
+ static shareSocially<T>(id: string, data: {
7001
+ platform: string;
7002
+ content: string;
7003
+ }): AxiosPromise<Response<T>>;
6996
7004
  /**
6997
- * Get the authenticated user's specific entry status for this raffle.
7005
+ * Send an invitation email to a friend.
6998
7006
  */
6999
- static me<T>(raffle_id: string): AxiosPromise<Response<T>>;
7007
+ static inviteFriend<T>(id: string, data: {
7008
+ email: string;
7009
+ }): AxiosPromise<Response<T>>;
7000
7010
  /**
7001
- * Submit shipping address for a winning entry.
7002
- * @param entry_id The UUID of the RaffleEntry.
7011
+ * Add a prize tier to a raffle (Game Owner).
7003
7012
  */
7004
- static updateAddress<T>(entry_id: string, data: object): AxiosPromise<Response<T>>;
7013
+ static addPrize<T>(id: string, data: object): AxiosPromise<Response<T>>;
7005
7014
  /**
7006
- * Invite a friend via email to join the raffle.
7015
+ * Trigger the automated drawing process (Game Owner).
7007
7016
  */
7008
- static inviteFriend<T>(raffle_id: string, data: {
7009
- email: string;
7010
- }): AxiosPromise<Response<T>>;
7017
+ static drawWinners<T>(id: string): AxiosPromise<Response<T>>;
7011
7018
  /**
7012
- * Get the public list of winners (only available if raffle is completed).
7019
+ * Manually select a winner for a specific prize (Live Event Mode).
7013
7020
  */
7014
- static winners<T>(raffle_id: string): AxiosPromise<Response<T>>;
7021
+ static pickWinner<T>(id: string, data: {
7022
+ entry_id: string;
7023
+ prize_id: string;
7024
+ }): AxiosPromise<Response<T>>;
7015
7025
  /**
7016
- * Add a prize tier (quantity, value, description) to the raffle.
7026
+ * Get the public list of winners for a completed raffle.
7017
7027
  */
7018
- static addPrize<T>(raffle_id: string, data: object): AxiosPromise<Response<T>>;
7028
+ static winners<T>(id: string): AxiosPromise<Response<T>>;
7019
7029
  /**
7020
- * Randomly draw winners for all prize tiers based on ticket weights.
7030
+ * List all participants/entries for a raffle (Game Owner).
7021
7031
  */
7022
- static drawWinners<T>(raffle_id: string): AxiosPromise<Response<T>>;
7032
+ static participants<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
7023
7033
  /**
7024
- * Manually assign a specific user to a specific prize (Live Event Mode).
7025
- * @param data { entry_id, prize_id }
7034
+ * Update shipping/tracking info for a prize (Game Owner).
7026
7035
  */
7027
- static pickWinner<T>(raffle_id: string, data: object): AxiosPromise<Response<T>>;
7036
+ static fulfillPrize<T>(entry_id: string, data: {
7037
+ tracking_number: string;
7038
+ shipping_carrier: string;
7039
+ }): AxiosPromise<Response<T>>;
7028
7040
  /**
7029
- * Provide shipping/tracking info for a prize fulfillment.
7030
- * @param entry_id The UUID of the RaffleEntry.
7041
+ * Submit shipping address for a won prize (User/Winner).
7031
7042
  */
7032
- static fulfillPrize<T>(entry_id: string, data: object): AxiosPromise<Response<T>>;
7043
+ static updateAddress<T>(entry_id: string, data: object): AxiosPromise<Response<T>>;
7033
7044
  /**
7034
- * Disqualify an entry for fraud or rule violations.
7045
+ * Disqualify a specific entry (Game Owner).
7035
7046
  */
7036
- static disqualify<T>(raffle_id: string, entry_id: string, data: {
7047
+ static disqualify<T>(id: string, entry_id: string, data: {
7037
7048
  reason: string;
7038
7049
  }): AxiosPromise<Response<T>>;
7039
7050
  /**
7040
- * List all participants/entries for management.
7041
- * @param params { opt_in_playtesting?, page?, per_page? }
7051
+ * Check if the raffle is fully funded in the community ledger.
7042
7052
  */
7043
- static listParticipants<T>(raffle_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
7053
+ static escrowStatus<T>(id: string): AxiosPromise<Response<T>>;
7044
7054
  /**
7045
- * Check if the raffle is fully funded in the community ledger.
7055
+ * Get viral loop analytics (K-Factor, Cost Per Entry).
7056
+ */
7057
+ static analytics<T>(id: string): AxiosPromise<Response<T>>;
7058
+ /**
7059
+ * Update a raffle (Game Owner).
7060
+ * Handles status transitions (e.g., moving from draft to active).
7061
+ */
7062
+ static update<T>(id: string, data: object): AxiosPromise<Response<T>>;
7063
+ }
7064
+
7065
+ declare class DiscordMarketplace {
7066
+ /**
7067
+ * Search for Discord servers available for sponsorship.
7046
7068
  */
7047
- static escrowStatus<T>(raffle_id: string): AxiosPromise<Response<T>>;
7069
+ static listListings<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
7070
+ /**
7071
+ * List a Discord server in the marketplace (Owner).
7072
+ */
7073
+ static createListing<T>(data: object): AxiosPromise<Response<T>>;
7074
+ /**
7075
+ * Get details for a specific server listing.
7076
+ */
7077
+ static viewListing<T>(id: string): AxiosPromise<Response<T>>;
7078
+ /**
7079
+ * Update listing settings like price or auto-approve (Owner).
7080
+ */
7081
+ static updateListing<T>(id: string, data: object): AxiosPromise<Response<T>>;
7082
+ /**
7083
+ * Remove a server from the marketplace (Owner).
7084
+ */
7085
+ static deleteListing<T>(id: string): AxiosPromise<Response<T>>;
7086
+ /**
7087
+ * List sponsored post orders. Use params { mode: 'buyer' | 'seller' }.
7088
+ */
7089
+ static listOrders<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
7090
+ /**
7091
+ * Submit a post to a Discord server for sponsorship (Game Developer).
7092
+ */
7093
+ static createOrder<T>(data: object): AxiosPromise<Response<T>>;
7094
+ /**
7095
+ * Get details for a specific order.
7096
+ */
7097
+ static viewOrder<T>(id: string): AxiosPromise<Response<T>>;
7098
+ /**
7099
+ * Approve and publish a sponsored post (Owner).
7100
+ */
7101
+ static approveOrder<T>(id: string): AxiosPromise<Response<T>>;
7102
+ /**
7103
+ * Reject a sponsored post (Owner).
7104
+ */
7105
+ static rejectOrder<T>(id: string, data: {
7106
+ reason: string;
7107
+ }): AxiosPromise<Response<T>>;
7108
+ /**
7109
+ * Request changes to the post content (Owner).
7110
+ */
7111
+ static requestChanges<T>(id: string, data: {
7112
+ reason: string;
7113
+ }): AxiosPromise<Response<T>>;
7048
7114
  /**
7049
- * Get viral loop analytics (K-factor, Cost Per Entry).
7115
+ * Resubmit a post after making requested changes (Game Developer).
7050
7116
  */
7051
- static analytics<T>(raffle_id: string): AxiosPromise<Response<T>>;
7117
+ static resubmitOrder<T>(id: string): AxiosPromise<Response<T>>;
7052
7118
  }
7053
7119
 
7054
7120
  interface Route {
@@ -7399,6 +7465,7 @@ declare class Glitch {
7399
7465
  MarketingAgencies: typeof MarketingAgencies;
7400
7466
  TwitchReporting: typeof TwitchReporting;
7401
7467
  Raffles: typeof Raffles;
7468
+ DiscordMarketplace: typeof DiscordMarketplace;
7402
7469
  };
7403
7470
  static util: {
7404
7471
  Requests: typeof Requests;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -0,0 +1,92 @@
1
+ import DiscordMarketplaceRoute from "../routes/DiscordMarketplaceRoute";
2
+ import Requests from "../util/Requests";
3
+ import Response from "../util/Response";
4
+ import { AxiosPromise } from "axios";
5
+
6
+ class DiscordMarketplace {
7
+ /**
8
+ * Search for Discord servers available for sponsorship.
9
+ */
10
+ public static listListings<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
11
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.listListings, undefined, undefined, params);
12
+ }
13
+
14
+ /**
15
+ * List a Discord server in the marketplace (Owner).
16
+ */
17
+ public static createListing<T>(data: object): AxiosPromise<Response<T>> {
18
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.createListing, data);
19
+ }
20
+
21
+ /**
22
+ * Get details for a specific server listing.
23
+ */
24
+ public static viewListing<T>(id: string): AxiosPromise<Response<T>> {
25
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.viewListing, {}, { id });
26
+ }
27
+
28
+ /**
29
+ * Update listing settings like price or auto-approve (Owner).
30
+ */
31
+ public static updateListing<T>(id: string, data: object): AxiosPromise<Response<T>> {
32
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.updateListing, data, { id });
33
+ }
34
+
35
+ /**
36
+ * Remove a server from the marketplace (Owner).
37
+ */
38
+ public static deleteListing<T>(id: string): AxiosPromise<Response<T>> {
39
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.deleteListing, {}, { id });
40
+ }
41
+
42
+ /**
43
+ * List sponsored post orders. Use params { mode: 'buyer' | 'seller' }.
44
+ */
45
+ public static listOrders<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
46
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.listOrders, undefined, undefined, params);
47
+ }
48
+
49
+ /**
50
+ * Submit a post to a Discord server for sponsorship (Game Developer).
51
+ */
52
+ public static createOrder<T>(data: object): AxiosPromise<Response<T>> {
53
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.createOrder, data);
54
+ }
55
+
56
+ /**
57
+ * Get details for a specific order.
58
+ */
59
+ public static viewOrder<T>(id: string): AxiosPromise<Response<T>> {
60
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.viewOrder, {}, { id });
61
+ }
62
+
63
+ /**
64
+ * Approve and publish a sponsored post (Owner).
65
+ */
66
+ public static approveOrder<T>(id: string): AxiosPromise<Response<T>> {
67
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.approveOrder, {}, { id });
68
+ }
69
+
70
+ /**
71
+ * Reject a sponsored post (Owner).
72
+ */
73
+ public static rejectOrder<T>(id: string, data: { reason: string }): AxiosPromise<Response<T>> {
74
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.rejectOrder, data, { id });
75
+ }
76
+
77
+ /**
78
+ * Request changes to the post content (Owner).
79
+ */
80
+ public static requestChanges<T>(id: string, data: { reason: string }): AxiosPromise<Response<T>> {
81
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.requestChanges, data, { id });
82
+ }
83
+
84
+ /**
85
+ * Resubmit a post after making requested changes (Game Developer).
86
+ */
87
+ public static resubmitOrder<T>(id: string): AxiosPromise<Response<T>> {
88
+ return Requests.processRoute(DiscordMarketplaceRoute.routes.resubmitOrder, {}, { id });
89
+ }
90
+ }
91
+
92
+ export default DiscordMarketplace;
@@ -4,145 +4,138 @@ import Response from "../util/Response";
4
4
  import { AxiosPromise } from "axios";
5
5
 
6
6
  class Raffles {
7
-
8
7
  /**
9
- * List all raffles.
10
- * @param params Filter by title_id, community_id, or status.
8
+ * List all raffles with optional filters.
11
9
  */
12
10
  public static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
13
11
  return Requests.processRoute(RafflesRoute.routes.list, undefined, undefined, params);
14
12
  }
15
13
 
16
14
  /**
17
- * Create a new raffle for a specific title.
15
+ * Create a new raffle (Game Owner).
18
16
  */
19
17
  public static create<T>(data: object): AxiosPromise<Response<T>> {
20
18
  return Requests.processRoute(RafflesRoute.routes.create, data);
21
19
  }
22
20
 
23
21
  /**
24
- * Get full details of a raffle.
22
+ * Retrieve details for a specific raffle.
25
23
  */
26
- public static view<T>(raffle_id: string): AxiosPromise<Response<T>> {
27
- return Requests.processRoute(RafflesRoute.routes.view, {}, { raffle_id });
24
+ public static view<T>(id: string): AxiosPromise<Response<T>> {
25
+ return Requests.processRoute(RafflesRoute.routes.view, {}, { id });
28
26
  }
29
27
 
30
28
  /**
31
- * Update raffle settings (Draft/Active status, dates, etc).
29
+ * Enter a raffle (User/Player). Requires Steam ID.
32
30
  */
33
- public static update<T>(raffle_id: string, data: object): AxiosPromise<Response<T>> {
34
- return Requests.processRoute(RafflesRoute.routes.update, data, { raffle_id });
31
+ public static enter<T>(id: string, data: { referral_code?: string, device_fingerprint?: string, opt_in_playtesting?: boolean }): AxiosPromise<Response<T>> {
32
+ return Requests.processRoute(RafflesRoute.routes.enter, data, { id });
35
33
  }
36
34
 
37
35
  /**
38
- * Delete a raffle.
36
+ * Get the authenticated user's entry status for a specific raffle.
39
37
  */
40
- public static delete<T>(raffle_id: string): AxiosPromise<Response<T>> {
41
- return Requests.processRoute(RafflesRoute.routes.delete, {}, { raffle_id });
38
+ public static me<T>(id: string): AxiosPromise<Response<T>> {
39
+ return Requests.processRoute(RafflesRoute.routes.me, {}, { id });
42
40
  }
43
41
 
44
42
  /**
45
- * Enter the authenticated user into the raffle.
46
- * @param data { referral_code?, device_fingerprint? }
43
+ * Record a viral action (e.g., Steam Wishlist, Social Share).
47
44
  */
48
- public static enter<T>(raffle_id: string, data?: object): AxiosPromise<Response<T>> {
49
- return Requests.processRoute(RafflesRoute.routes.enter, data, { raffle_id });
45
+ public static performAction<T>(id: string, data: { action_type: string, platform?: string, reference_id?: string }): AxiosPromise<Response<T>> {
46
+ return Requests.processRoute(RafflesRoute.routes.performAction, data, { id });
50
47
  }
51
48
 
52
49
  /**
53
- * Record a viral action (Steam Wishlist, Social Share) to earn more tickets.
54
- * @param data { action_type: 'steam_wishlist'|'social_share', platform?, reference_id? }
50
+ * Post raffle content to social media via Glitch API.
55
51
  */
56
- public static performAction<T>(raffle_id: string, data: object): AxiosPromise<Response<T>> {
57
- return Requests.processRoute(RafflesRoute.routes.performAction, data, { raffle_id });
52
+ public static shareSocially<T>(id: string, data: { platform: string, content: string }): AxiosPromise<Response<T>> {
53
+ return Requests.processRoute(RafflesRoute.routes.shareSocially, data, { id });
58
54
  }
59
55
 
60
56
  /**
61
- * Get the authenticated user's specific entry status for this raffle.
57
+ * Send an invitation email to a friend.
62
58
  */
63
- public static me<T>(raffle_id: string): AxiosPromise<Response<T>> {
64
- return Requests.processRoute(RafflesRoute.routes.me, {}, { raffle_id });
59
+ public static inviteFriend<T>(id: string, data: { email: string }): AxiosPromise<Response<T>> {
60
+ return Requests.processRoute(RafflesRoute.routes.inviteFriend, data, { id });
65
61
  }
66
62
 
67
63
  /**
68
- * Submit shipping address for a winning entry.
69
- * @param entry_id The UUID of the RaffleEntry.
64
+ * Add a prize tier to a raffle (Game Owner).
70
65
  */
71
- public static updateAddress<T>(entry_id: string, data: object): AxiosPromise<Response<T>> {
72
- return Requests.processRoute(RafflesRoute.routes.updateAddress, data, { entry_id });
66
+ public static addPrize<T>(id: string, data: object): AxiosPromise<Response<T>> {
67
+ return Requests.processRoute(RafflesRoute.routes.addPrize, data, { id });
73
68
  }
74
69
 
75
70
  /**
76
- * Invite a friend via email to join the raffle.
71
+ * Trigger the automated drawing process (Game Owner).
77
72
  */
78
- public static inviteFriend<T>(raffle_id: string, data: { email: string }): AxiosPromise<Response<T>> {
79
- return Requests.processRoute(RafflesRoute.routes.inviteFriend, data, { raffle_id });
73
+ public static drawWinners<T>(id: string): AxiosPromise<Response<T>> {
74
+ return Requests.processRoute(RafflesRoute.routes.drawWinners, {}, { id });
80
75
  }
81
76
 
82
77
  /**
83
- * Get the public list of winners (only available if raffle is completed).
78
+ * Manually select a winner for a specific prize (Live Event Mode).
84
79
  */
85
- public static winners<T>(raffle_id: string): AxiosPromise<Response<T>> {
86
- return Requests.processRoute(RafflesRoute.routes.winners, {}, { raffle_id });
80
+ public static pickWinner<T>(id: string, data: { entry_id: string, prize_id: string }): AxiosPromise<Response<T>> {
81
+ return Requests.processRoute(RafflesRoute.routes.pickWinner, data, { id });
87
82
  }
88
83
 
89
84
  /**
90
- * Add a prize tier (quantity, value, description) to the raffle.
85
+ * Get the public list of winners for a completed raffle.
91
86
  */
92
- public static addPrize<T>(raffle_id: string, data: object): AxiosPromise<Response<T>> {
93
- return Requests.processRoute(RafflesRoute.routes.addPrize, data, { raffle_id });
87
+ public static winners<T>(id: string): AxiosPromise<Response<T>> {
88
+ return Requests.processRoute(RafflesRoute.routes.winners, {}, { id });
94
89
  }
95
90
 
96
91
  /**
97
- * Randomly draw winners for all prize tiers based on ticket weights.
92
+ * List all participants/entries for a raffle (Game Owner).
98
93
  */
99
- public static drawWinners<T>(raffle_id: string): AxiosPromise<Response<T>> {
100
- return Requests.processRoute(RafflesRoute.routes.drawWinners, {}, { raffle_id });
94
+ public static participants<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
95
+ return Requests.processRoute(RafflesRoute.routes.participants, {}, { id }, params);
101
96
  }
102
97
 
103
98
  /**
104
- * Manually assign a specific user to a specific prize (Live Event Mode).
105
- * @param data { entry_id, prize_id }
99
+ * Update shipping/tracking info for a prize (Game Owner).
106
100
  */
107
- public static pickWinner<T>(raffle_id: string, data: object): AxiosPromise<Response<T>> {
108
- return Requests.processRoute(RafflesRoute.routes.pickWinner, data, { raffle_id });
101
+ public static fulfillPrize<T>(entry_id: string, data: { tracking_number: string, shipping_carrier: string }): AxiosPromise<Response<T>> {
102
+ return Requests.processRoute(RafflesRoute.routes.fulfillPrize, data, { entry_id });
109
103
  }
110
104
 
111
105
  /**
112
- * Provide shipping/tracking info for a prize fulfillment.
113
- * @param entry_id The UUID of the RaffleEntry.
106
+ * Submit shipping address for a won prize (User/Winner).
114
107
  */
115
- public static fulfillPrize<T>(entry_id: string, data: object): AxiosPromise<Response<T>> {
116
- return Requests.processRoute(RafflesRoute.routes.fulfillPrize, data, { entry_id });
108
+ public static updateAddress<T>(entry_id: string, data: object): AxiosPromise<Response<T>> {
109
+ return Requests.processRoute(RafflesRoute.routes.updateAddress, data, { entry_id });
117
110
  }
118
111
 
119
112
  /**
120
- * Disqualify an entry for fraud or rule violations.
113
+ * Disqualify a specific entry (Game Owner).
121
114
  */
122
- public static disqualify<T>(raffle_id: string, entry_id: string, data: { reason: string }): AxiosPromise<Response<T>> {
123
- return Requests.processRoute(RafflesRoute.routes.disqualify, data, { raffle_id, entry_id });
115
+ public static disqualify<T>(id: string, entry_id: string, data: { reason: string }): AxiosPromise<Response<T>> {
116
+ return Requests.processRoute(RafflesRoute.routes.disqualify, data, { id, entry_id });
124
117
  }
125
118
 
126
119
  /**
127
- * List all participants/entries for management.
128
- * @param params { opt_in_playtesting?, page?, per_page? }
120
+ * Check if the raffle is fully funded in the community ledger.
129
121
  */
130
- public static listParticipants<T>(raffle_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
131
- return Requests.processRoute(RafflesRoute.routes.participants, {}, { raffle_id }, params);
122
+ public static escrowStatus<T>(id: string): AxiosPromise<Response<T>> {
123
+ return Requests.processRoute(RafflesRoute.routes.escrowStatus, {}, { id });
132
124
  }
133
125
 
134
126
  /**
135
- * Check if the raffle is fully funded in the community ledger.
127
+ * Get viral loop analytics (K-Factor, Cost Per Entry).
136
128
  */
137
- public static escrowStatus<T>(raffle_id: string): AxiosPromise<Response<T>> {
138
- return Requests.processRoute(RafflesRoute.routes.escrowStatus, {}, { raffle_id });
129
+ public static analytics<T>(id: string): AxiosPromise<Response<T>> {
130
+ return Requests.processRoute(RafflesRoute.routes.analytics, {}, { id });
139
131
  }
140
132
 
141
133
  /**
142
- * Get viral loop analytics (K-factor, Cost Per Entry).
134
+ * Update a raffle (Game Owner).
135
+ * Handles status transitions (e.g., moving from draft to active).
143
136
  */
144
- public static analytics<T>(raffle_id: string): AxiosPromise<Response<T>> {
145
- return Requests.processRoute(RafflesRoute.routes.analytics, {}, { raffle_id });
137
+ public static update<T>(id: string, data: object): AxiosPromise<Response<T>> {
138
+ return Requests.processRoute(RafflesRoute.routes.update, data, { id });
146
139
  }
147
140
  }
148
141
 
package/src/api/index.ts CHANGED
@@ -39,6 +39,7 @@ import AIUsage from "./AIUsage";
39
39
  import MarketingAgencies from "./MarketingAgencies";
40
40
  import TwitchReporting from "./TwitchReporting";
41
41
  import Raffles from "./Raffles";
42
+ import DiscordMarketplace from "./DiscordMarketplace";
42
43
 
43
44
  export {Ads};
44
45
  export {AccessKeys};
@@ -80,4 +81,5 @@ export {ShortLinks};
80
81
  export {AIUsage};
81
82
  export {MarketingAgencies};
82
83
  export {TwitchReporting};
83
- export {Raffles};
84
+ export {Raffles};
85
+ export {DiscordMarketplace};
package/src/index.ts CHANGED
@@ -43,6 +43,7 @@ import {AIUsage} from "./api";
43
43
  import {MarketingAgencies} from "./api"
44
44
  import {TwitchReporting} from './api'
45
45
  import {Raffles} from './api'
46
+ import {DiscordMarketplace} from './api';
46
47
 
47
48
  import Requests from "./util/Requests";
48
49
  import Parser from "./util/Parser";
@@ -115,6 +116,7 @@ class Glitch {
115
116
  MarketingAgencies : MarketingAgencies,
116
117
  TwitchReporting: TwitchReporting,
117
118
  Raffles : Raffles,
119
+ DiscordMarketplace : DiscordMarketplace,
118
120
  }
119
121
 
120
122
  public static util = {
@@ -0,0 +1,24 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class DiscordMarketplaceRoute {
5
+ public static routes: { [key: string]: Route } = {
6
+ // Listings
7
+ listListings: { url: '/discord-marketplace/listings', method: HTTP_METHODS.GET },
8
+ createListing: { url: '/discord-marketplace/listings', method: HTTP_METHODS.POST },
9
+ viewListing: { url: '/discord-marketplace/listings/{id}', method: HTTP_METHODS.GET },
10
+ updateListing: { url: '/discord-marketplace/listings/{id}', method: HTTP_METHODS.PUT },
11
+ deleteListing: { url: '/discord-marketplace/listings/{id}', method: HTTP_METHODS.DELETE },
12
+
13
+ // Orders
14
+ listOrders: { url: '/discord-marketplace/orders', method: HTTP_METHODS.GET },
15
+ createOrder: { url: '/discord-marketplace/orders', method: HTTP_METHODS.POST },
16
+ viewOrder: { url: '/discord-marketplace/orders/{id}', method: HTTP_METHODS.GET },
17
+ approveOrder: { url: '/discord-marketplace/orders/{id}/approve', method: HTTP_METHODS.POST },
18
+ rejectOrder: { url: '/discord-marketplace/orders/{id}/reject', method: HTTP_METHODS.POST },
19
+ requestChanges: { url: '/discord-marketplace/orders/{id}/request-changes', method: HTTP_METHODS.POST },
20
+ resubmitOrder: { url: '/discord-marketplace/orders/{id}/resubmit', method: HTTP_METHODS.POST },
21
+ };
22
+ }
23
+
24
+ export default DiscordMarketplaceRoute;