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.
- package/dist/cjs/index.js +174 -78
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/DiscordMarketplace.d.ts +57 -0
- package/dist/esm/api/Raffles.d.ts +56 -45
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +174 -78
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/DiscordMarketplaceRoute.d.ts +7 -0
- package/dist/index.d.ts +112 -45
- package/package.json +1 -1
- package/src/api/DiscordMarketplace.ts +92 -0
- package/src/api/Raffles.ts +54 -61
- package/src/api/index.ts +3 -1
- package/src/index.ts +2 -0
- package/src/routes/DiscordMarketplaceRoute.ts +24 -0
- package/src/routes/RafflesRoute.ts +29 -28
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import Response from "../util/Response";
|
|
2
|
+
import { AxiosPromise } from "axios";
|
|
3
|
+
declare class DiscordMarketplace {
|
|
4
|
+
/**
|
|
5
|
+
* Search for Discord servers available for sponsorship.
|
|
6
|
+
*/
|
|
7
|
+
static listListings<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
8
|
+
/**
|
|
9
|
+
* List a Discord server in the marketplace (Owner).
|
|
10
|
+
*/
|
|
11
|
+
static createListing<T>(data: object): AxiosPromise<Response<T>>;
|
|
12
|
+
/**
|
|
13
|
+
* Get details for a specific server listing.
|
|
14
|
+
*/
|
|
15
|
+
static viewListing<T>(id: string): AxiosPromise<Response<T>>;
|
|
16
|
+
/**
|
|
17
|
+
* Update listing settings like price or auto-approve (Owner).
|
|
18
|
+
*/
|
|
19
|
+
static updateListing<T>(id: string, data: object): AxiosPromise<Response<T>>;
|
|
20
|
+
/**
|
|
21
|
+
* Remove a server from the marketplace (Owner).
|
|
22
|
+
*/
|
|
23
|
+
static deleteListing<T>(id: string): AxiosPromise<Response<T>>;
|
|
24
|
+
/**
|
|
25
|
+
* List sponsored post orders. Use params { mode: 'buyer' | 'seller' }.
|
|
26
|
+
*/
|
|
27
|
+
static listOrders<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
28
|
+
/**
|
|
29
|
+
* Submit a post to a Discord server for sponsorship (Game Developer).
|
|
30
|
+
*/
|
|
31
|
+
static createOrder<T>(data: object): AxiosPromise<Response<T>>;
|
|
32
|
+
/**
|
|
33
|
+
* Get details for a specific order.
|
|
34
|
+
*/
|
|
35
|
+
static viewOrder<T>(id: string): AxiosPromise<Response<T>>;
|
|
36
|
+
/**
|
|
37
|
+
* Approve and publish a sponsored post (Owner).
|
|
38
|
+
*/
|
|
39
|
+
static approveOrder<T>(id: string): AxiosPromise<Response<T>>;
|
|
40
|
+
/**
|
|
41
|
+
* Reject a sponsored post (Owner).
|
|
42
|
+
*/
|
|
43
|
+
static rejectOrder<T>(id: string, data: {
|
|
44
|
+
reason: string;
|
|
45
|
+
}): AxiosPromise<Response<T>>;
|
|
46
|
+
/**
|
|
47
|
+
* Request changes to the post content (Owner).
|
|
48
|
+
*/
|
|
49
|
+
static requestChanges<T>(id: string, data: {
|
|
50
|
+
reason: string;
|
|
51
|
+
}): AxiosPromise<Response<T>>;
|
|
52
|
+
/**
|
|
53
|
+
* Resubmit a post after making requested changes (Game Developer).
|
|
54
|
+
*/
|
|
55
|
+
static resubmitOrder<T>(id: string): AxiosPromise<Response<T>>;
|
|
56
|
+
}
|
|
57
|
+
export default DiscordMarketplace;
|
|
@@ -2,91 +2,102 @@ import Response from "../util/Response";
|
|
|
2
2
|
import { AxiosPromise } from "axios";
|
|
3
3
|
declare class Raffles {
|
|
4
4
|
/**
|
|
5
|
-
* List all raffles.
|
|
6
|
-
* @param params Filter by title_id, community_id, or status.
|
|
5
|
+
* List all raffles with optional filters.
|
|
7
6
|
*/
|
|
8
7
|
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
9
8
|
/**
|
|
10
|
-
* Create a new raffle
|
|
9
|
+
* Create a new raffle (Game Owner).
|
|
11
10
|
*/
|
|
12
11
|
static create<T>(data: object): AxiosPromise<Response<T>>;
|
|
13
12
|
/**
|
|
14
|
-
*
|
|
13
|
+
* Retrieve details for a specific raffle.
|
|
15
14
|
*/
|
|
16
|
-
static view<T>(
|
|
15
|
+
static view<T>(id: string): AxiosPromise<Response<T>>;
|
|
17
16
|
/**
|
|
18
|
-
*
|
|
17
|
+
* Enter a raffle (User/Player). Requires Steam ID.
|
|
19
18
|
*/
|
|
20
|
-
static
|
|
19
|
+
static enter<T>(id: string, data: {
|
|
20
|
+
referral_code?: string;
|
|
21
|
+
device_fingerprint?: string;
|
|
22
|
+
opt_in_playtesting?: boolean;
|
|
23
|
+
}): AxiosPromise<Response<T>>;
|
|
21
24
|
/**
|
|
22
|
-
*
|
|
25
|
+
* Get the authenticated user's entry status for a specific raffle.
|
|
23
26
|
*/
|
|
24
|
-
static
|
|
27
|
+
static me<T>(id: string): AxiosPromise<Response<T>>;
|
|
25
28
|
/**
|
|
26
|
-
*
|
|
27
|
-
* @param data { referral_code?, device_fingerprint? }
|
|
29
|
+
* Record a viral action (e.g., Steam Wishlist, Social Share).
|
|
28
30
|
*/
|
|
29
|
-
static
|
|
31
|
+
static performAction<T>(id: string, data: {
|
|
32
|
+
action_type: string;
|
|
33
|
+
platform?: string;
|
|
34
|
+
reference_id?: string;
|
|
35
|
+
}): AxiosPromise<Response<T>>;
|
|
30
36
|
/**
|
|
31
|
-
*
|
|
32
|
-
* @param data { action_type: 'steam_wishlist'|'social_share', platform?, reference_id? }
|
|
37
|
+
* Post raffle content to social media via Glitch API.
|
|
33
38
|
*/
|
|
34
|
-
static
|
|
39
|
+
static shareSocially<T>(id: string, data: {
|
|
40
|
+
platform: string;
|
|
41
|
+
content: string;
|
|
42
|
+
}): AxiosPromise<Response<T>>;
|
|
35
43
|
/**
|
|
36
|
-
*
|
|
44
|
+
* Send an invitation email to a friend.
|
|
37
45
|
*/
|
|
38
|
-
static
|
|
46
|
+
static inviteFriend<T>(id: string, data: {
|
|
47
|
+
email: string;
|
|
48
|
+
}): AxiosPromise<Response<T>>;
|
|
39
49
|
/**
|
|
40
|
-
*
|
|
41
|
-
* @param entry_id The UUID of the RaffleEntry.
|
|
50
|
+
* Add a prize tier to a raffle (Game Owner).
|
|
42
51
|
*/
|
|
43
|
-
static
|
|
52
|
+
static addPrize<T>(id: string, data: object): AxiosPromise<Response<T>>;
|
|
44
53
|
/**
|
|
45
|
-
*
|
|
54
|
+
* Trigger the automated drawing process (Game Owner).
|
|
46
55
|
*/
|
|
47
|
-
static
|
|
48
|
-
email: string;
|
|
49
|
-
}): AxiosPromise<Response<T>>;
|
|
56
|
+
static drawWinners<T>(id: string): AxiosPromise<Response<T>>;
|
|
50
57
|
/**
|
|
51
|
-
*
|
|
58
|
+
* Manually select a winner for a specific prize (Live Event Mode).
|
|
52
59
|
*/
|
|
53
|
-
static
|
|
60
|
+
static pickWinner<T>(id: string, data: {
|
|
61
|
+
entry_id: string;
|
|
62
|
+
prize_id: string;
|
|
63
|
+
}): AxiosPromise<Response<T>>;
|
|
54
64
|
/**
|
|
55
|
-
*
|
|
65
|
+
* Get the public list of winners for a completed raffle.
|
|
56
66
|
*/
|
|
57
|
-
static
|
|
67
|
+
static winners<T>(id: string): AxiosPromise<Response<T>>;
|
|
58
68
|
/**
|
|
59
|
-
*
|
|
69
|
+
* List all participants/entries for a raffle (Game Owner).
|
|
60
70
|
*/
|
|
61
|
-
static
|
|
71
|
+
static participants<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
62
72
|
/**
|
|
63
|
-
*
|
|
64
|
-
* @param data { entry_id, prize_id }
|
|
73
|
+
* Update shipping/tracking info for a prize (Game Owner).
|
|
65
74
|
*/
|
|
66
|
-
static
|
|
75
|
+
static fulfillPrize<T>(entry_id: string, data: {
|
|
76
|
+
tracking_number: string;
|
|
77
|
+
shipping_carrier: string;
|
|
78
|
+
}): AxiosPromise<Response<T>>;
|
|
67
79
|
/**
|
|
68
|
-
*
|
|
69
|
-
* @param entry_id The UUID of the RaffleEntry.
|
|
80
|
+
* Submit shipping address for a won prize (User/Winner).
|
|
70
81
|
*/
|
|
71
|
-
static
|
|
82
|
+
static updateAddress<T>(entry_id: string, data: object): AxiosPromise<Response<T>>;
|
|
72
83
|
/**
|
|
73
|
-
* Disqualify
|
|
84
|
+
* Disqualify a specific entry (Game Owner).
|
|
74
85
|
*/
|
|
75
|
-
static disqualify<T>(
|
|
86
|
+
static disqualify<T>(id: string, entry_id: string, data: {
|
|
76
87
|
reason: string;
|
|
77
88
|
}): AxiosPromise<Response<T>>;
|
|
78
89
|
/**
|
|
79
|
-
*
|
|
80
|
-
* @param params { opt_in_playtesting?, page?, per_page? }
|
|
90
|
+
* Check if the raffle is fully funded in the community ledger.
|
|
81
91
|
*/
|
|
82
|
-
static
|
|
92
|
+
static escrowStatus<T>(id: string): AxiosPromise<Response<T>>;
|
|
83
93
|
/**
|
|
84
|
-
*
|
|
94
|
+
* Get viral loop analytics (K-Factor, Cost Per Entry).
|
|
85
95
|
*/
|
|
86
|
-
static
|
|
96
|
+
static analytics<T>(id: string): AxiosPromise<Response<T>>;
|
|
87
97
|
/**
|
|
88
|
-
*
|
|
98
|
+
* Update a raffle (Game Owner).
|
|
99
|
+
* Handles status transitions (e.g., moving from draft to active).
|
|
89
100
|
*/
|
|
90
|
-
static
|
|
101
|
+
static update<T>(id: string, data: object): AxiosPromise<Response<T>>;
|
|
91
102
|
}
|
|
92
103
|
export default Raffles;
|
package/dist/esm/api/index.d.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
|
export { Ads };
|
|
43
44
|
export { AccessKeys };
|
|
44
45
|
export { Auth };
|
|
@@ -80,3 +81,4 @@ export { AIUsage };
|
|
|
80
81
|
export { MarketingAgencies };
|
|
81
82
|
export { TwitchReporting };
|
|
82
83
|
export { Raffles };
|
|
84
|
+
export { DiscordMarketplace };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ import { AIUsage } from "./api";
|
|
|
39
39
|
import { MarketingAgencies } from "./api";
|
|
40
40
|
import { TwitchReporting } from './api';
|
|
41
41
|
import { Raffles } from './api';
|
|
42
|
+
import { DiscordMarketplace } from './api';
|
|
42
43
|
import Requests from "./util/Requests";
|
|
43
44
|
import Parser from "./util/Parser";
|
|
44
45
|
import Session from "./util/Session";
|
|
@@ -99,6 +100,7 @@ declare class Glitch {
|
|
|
99
100
|
MarketingAgencies: typeof MarketingAgencies;
|
|
100
101
|
TwitchReporting: typeof TwitchReporting;
|
|
101
102
|
Raffles: typeof Raffles;
|
|
103
|
+
DiscordMarketplace: typeof DiscordMarketplace;
|
|
102
104
|
};
|
|
103
105
|
static util: {
|
|
104
106
|
Requests: typeof Requests;
|
package/dist/esm/index.js
CHANGED
|
@@ -16191,28 +16191,29 @@ var RafflesRoute = /** @class */ (function () {
|
|
|
16191
16191
|
function RafflesRoute() {
|
|
16192
16192
|
}
|
|
16193
16193
|
RafflesRoute.routes = {
|
|
16194
|
-
// CRUD
|
|
16195
16194
|
list: { url: '/raffles', method: HTTP_METHODS.GET },
|
|
16196
16195
|
create: { url: '/raffles', method: HTTP_METHODS.POST },
|
|
16197
|
-
view: { url: '/raffles/{
|
|
16198
|
-
update: { url: '/raffles/{
|
|
16199
|
-
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16209
|
-
|
|
16210
|
-
|
|
16196
|
+
view: { url: '/raffles/{id}', method: HTTP_METHODS.GET },
|
|
16197
|
+
update: { url: '/raffles/{id}', method: HTTP_METHODS.PUT },
|
|
16198
|
+
enter: { url: '/raffles/{id}/enter', method: HTTP_METHODS.POST },
|
|
16199
|
+
me: { url: '/raffles/{id}/me', method: HTTP_METHODS.GET },
|
|
16200
|
+
performAction: { url: '/raffles/{id}/actions', method: HTTP_METHODS.POST },
|
|
16201
|
+
shareSocially: { url: '/raffles/{id}/share', method: HTTP_METHODS.POST },
|
|
16202
|
+
inviteFriend: { url: '/raffles/{id}/invite-friend', method: HTTP_METHODS.POST },
|
|
16203
|
+
// Prize Management
|
|
16204
|
+
addPrize: { url: '/raffles/{id}/prizes', method: HTTP_METHODS.POST },
|
|
16205
|
+
// Drawing & Winners
|
|
16206
|
+
drawWinners: { url: '/raffles/{id}/draw', method: HTTP_METHODS.POST },
|
|
16207
|
+
pickWinner: { url: '/raffles/{id}/pick-winner', method: HTTP_METHODS.POST },
|
|
16208
|
+
winners: { url: '/raffles/{id}/winners', method: HTTP_METHODS.GET },
|
|
16209
|
+
// Participant & Fulfillment Management
|
|
16210
|
+
participants: { url: '/raffles/{id}/participants', method: HTTP_METHODS.GET },
|
|
16211
16211
|
fulfillPrize: { url: '/raffles/entries/{entry_id}/fulfill', method: HTTP_METHODS.PUT },
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
16215
|
-
|
|
16212
|
+
updateAddress: { url: '/raffles/entries/{entry_id}/address', method: HTTP_METHODS.PUT },
|
|
16213
|
+
disqualify: { url: '/raffles/{id}/disqualify/{entry_id}', method: HTTP_METHODS.POST },
|
|
16214
|
+
// Analytics & Finance
|
|
16215
|
+
escrowStatus: { url: '/raffles/{id}/escrow', method: HTTP_METHODS.GET },
|
|
16216
|
+
analytics: { url: '/raffles/{id}/analytics', method: HTTP_METHODS.GET },
|
|
16216
16217
|
};
|
|
16217
16218
|
return RafflesRoute;
|
|
16218
16219
|
}());
|
|
@@ -16221,127 +16222,221 @@ var Raffles = /** @class */ (function () {
|
|
|
16221
16222
|
function Raffles() {
|
|
16222
16223
|
}
|
|
16223
16224
|
/**
|
|
16224
|
-
* List all raffles.
|
|
16225
|
-
* @param params Filter by title_id, community_id, or status.
|
|
16225
|
+
* List all raffles with optional filters.
|
|
16226
16226
|
*/
|
|
16227
16227
|
Raffles.list = function (params) {
|
|
16228
16228
|
return Requests.processRoute(RafflesRoute.routes.list, undefined, undefined, params);
|
|
16229
16229
|
};
|
|
16230
16230
|
/**
|
|
16231
|
-
* Create a new raffle
|
|
16231
|
+
* Create a new raffle (Game Owner).
|
|
16232
16232
|
*/
|
|
16233
16233
|
Raffles.create = function (data) {
|
|
16234
16234
|
return Requests.processRoute(RafflesRoute.routes.create, data);
|
|
16235
16235
|
};
|
|
16236
16236
|
/**
|
|
16237
|
-
*
|
|
16237
|
+
* Retrieve details for a specific raffle.
|
|
16238
|
+
*/
|
|
16239
|
+
Raffles.view = function (id) {
|
|
16240
|
+
return Requests.processRoute(RafflesRoute.routes.view, {}, { id: id });
|
|
16241
|
+
};
|
|
16242
|
+
/**
|
|
16243
|
+
* Enter a raffle (User/Player). Requires Steam ID.
|
|
16244
|
+
*/
|
|
16245
|
+
Raffles.enter = function (id, data) {
|
|
16246
|
+
return Requests.processRoute(RafflesRoute.routes.enter, data, { id: id });
|
|
16247
|
+
};
|
|
16248
|
+
/**
|
|
16249
|
+
* Get the authenticated user's entry status for a specific raffle.
|
|
16250
|
+
*/
|
|
16251
|
+
Raffles.me = function (id) {
|
|
16252
|
+
return Requests.processRoute(RafflesRoute.routes.me, {}, { id: id });
|
|
16253
|
+
};
|
|
16254
|
+
/**
|
|
16255
|
+
* Record a viral action (e.g., Steam Wishlist, Social Share).
|
|
16256
|
+
*/
|
|
16257
|
+
Raffles.performAction = function (id, data) {
|
|
16258
|
+
return Requests.processRoute(RafflesRoute.routes.performAction, data, { id: id });
|
|
16259
|
+
};
|
|
16260
|
+
/**
|
|
16261
|
+
* Post raffle content to social media via Glitch API.
|
|
16262
|
+
*/
|
|
16263
|
+
Raffles.shareSocially = function (id, data) {
|
|
16264
|
+
return Requests.processRoute(RafflesRoute.routes.shareSocially, data, { id: id });
|
|
16265
|
+
};
|
|
16266
|
+
/**
|
|
16267
|
+
* Send an invitation email to a friend.
|
|
16238
16268
|
*/
|
|
16239
|
-
Raffles.
|
|
16240
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16269
|
+
Raffles.inviteFriend = function (id, data) {
|
|
16270
|
+
return Requests.processRoute(RafflesRoute.routes.inviteFriend, data, { id: id });
|
|
16241
16271
|
};
|
|
16242
16272
|
/**
|
|
16243
|
-
*
|
|
16273
|
+
* Add a prize tier to a raffle (Game Owner).
|
|
16244
16274
|
*/
|
|
16245
|
-
Raffles.
|
|
16246
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16275
|
+
Raffles.addPrize = function (id, data) {
|
|
16276
|
+
return Requests.processRoute(RafflesRoute.routes.addPrize, data, { id: id });
|
|
16247
16277
|
};
|
|
16248
16278
|
/**
|
|
16249
|
-
*
|
|
16279
|
+
* Trigger the automated drawing process (Game Owner).
|
|
16250
16280
|
*/
|
|
16251
|
-
Raffles.
|
|
16252
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16281
|
+
Raffles.drawWinners = function (id) {
|
|
16282
|
+
return Requests.processRoute(RafflesRoute.routes.drawWinners, {}, { id: id });
|
|
16253
16283
|
};
|
|
16254
16284
|
/**
|
|
16255
|
-
*
|
|
16256
|
-
* @param data { referral_code?, device_fingerprint? }
|
|
16285
|
+
* Manually select a winner for a specific prize (Live Event Mode).
|
|
16257
16286
|
*/
|
|
16258
|
-
Raffles.
|
|
16259
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16287
|
+
Raffles.pickWinner = function (id, data) {
|
|
16288
|
+
return Requests.processRoute(RafflesRoute.routes.pickWinner, data, { id: id });
|
|
16260
16289
|
};
|
|
16261
16290
|
/**
|
|
16262
|
-
*
|
|
16263
|
-
* @param data { action_type: 'steam_wishlist'|'social_share', platform?, reference_id? }
|
|
16291
|
+
* Get the public list of winners for a completed raffle.
|
|
16264
16292
|
*/
|
|
16265
|
-
Raffles.
|
|
16266
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16293
|
+
Raffles.winners = function (id) {
|
|
16294
|
+
return Requests.processRoute(RafflesRoute.routes.winners, {}, { id: id });
|
|
16267
16295
|
};
|
|
16268
16296
|
/**
|
|
16269
|
-
*
|
|
16297
|
+
* List all participants/entries for a raffle (Game Owner).
|
|
16270
16298
|
*/
|
|
16271
|
-
Raffles.
|
|
16272
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16299
|
+
Raffles.participants = function (id, params) {
|
|
16300
|
+
return Requests.processRoute(RafflesRoute.routes.participants, {}, { id: id }, params);
|
|
16273
16301
|
};
|
|
16274
16302
|
/**
|
|
16275
|
-
*
|
|
16276
|
-
|
|
16303
|
+
* Update shipping/tracking info for a prize (Game Owner).
|
|
16304
|
+
*/
|
|
16305
|
+
Raffles.fulfillPrize = function (entry_id, data) {
|
|
16306
|
+
return Requests.processRoute(RafflesRoute.routes.fulfillPrize, data, { entry_id: entry_id });
|
|
16307
|
+
};
|
|
16308
|
+
/**
|
|
16309
|
+
* Submit shipping address for a won prize (User/Winner).
|
|
16277
16310
|
*/
|
|
16278
16311
|
Raffles.updateAddress = function (entry_id, data) {
|
|
16279
16312
|
return Requests.processRoute(RafflesRoute.routes.updateAddress, data, { entry_id: entry_id });
|
|
16280
16313
|
};
|
|
16281
16314
|
/**
|
|
16282
|
-
*
|
|
16315
|
+
* Disqualify a specific entry (Game Owner).
|
|
16316
|
+
*/
|
|
16317
|
+
Raffles.disqualify = function (id, entry_id, data) {
|
|
16318
|
+
return Requests.processRoute(RafflesRoute.routes.disqualify, data, { id: id, entry_id: entry_id });
|
|
16319
|
+
};
|
|
16320
|
+
/**
|
|
16321
|
+
* Check if the raffle is fully funded in the community ledger.
|
|
16322
|
+
*/
|
|
16323
|
+
Raffles.escrowStatus = function (id) {
|
|
16324
|
+
return Requests.processRoute(RafflesRoute.routes.escrowStatus, {}, { id: id });
|
|
16325
|
+
};
|
|
16326
|
+
/**
|
|
16327
|
+
* Get viral loop analytics (K-Factor, Cost Per Entry).
|
|
16283
16328
|
*/
|
|
16284
|
-
Raffles.
|
|
16285
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16329
|
+
Raffles.analytics = function (id) {
|
|
16330
|
+
return Requests.processRoute(RafflesRoute.routes.analytics, {}, { id: id });
|
|
16286
16331
|
};
|
|
16287
16332
|
/**
|
|
16288
|
-
*
|
|
16333
|
+
* Update a raffle (Game Owner).
|
|
16334
|
+
* Handles status transitions (e.g., moving from draft to active).
|
|
16289
16335
|
*/
|
|
16290
|
-
Raffles.
|
|
16291
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16336
|
+
Raffles.update = function (id, data) {
|
|
16337
|
+
return Requests.processRoute(RafflesRoute.routes.update, data, { id: id });
|
|
16292
16338
|
};
|
|
16339
|
+
return Raffles;
|
|
16340
|
+
}());
|
|
16341
|
+
|
|
16342
|
+
var DiscordMarketplaceRoute = /** @class */ (function () {
|
|
16343
|
+
function DiscordMarketplaceRoute() {
|
|
16344
|
+
}
|
|
16345
|
+
DiscordMarketplaceRoute.routes = {
|
|
16346
|
+
// Listings
|
|
16347
|
+
listListings: { url: '/discord-marketplace/listings', method: HTTP_METHODS.GET },
|
|
16348
|
+
createListing: { url: '/discord-marketplace/listings', method: HTTP_METHODS.POST },
|
|
16349
|
+
viewListing: { url: '/discord-marketplace/listings/{id}', method: HTTP_METHODS.GET },
|
|
16350
|
+
updateListing: { url: '/discord-marketplace/listings/{id}', method: HTTP_METHODS.PUT },
|
|
16351
|
+
deleteListing: { url: '/discord-marketplace/listings/{id}', method: HTTP_METHODS.DELETE },
|
|
16352
|
+
// Orders
|
|
16353
|
+
listOrders: { url: '/discord-marketplace/orders', method: HTTP_METHODS.GET },
|
|
16354
|
+
createOrder: { url: '/discord-marketplace/orders', method: HTTP_METHODS.POST },
|
|
16355
|
+
viewOrder: { url: '/discord-marketplace/orders/{id}', method: HTTP_METHODS.GET },
|
|
16356
|
+
approveOrder: { url: '/discord-marketplace/orders/{id}/approve', method: HTTP_METHODS.POST },
|
|
16357
|
+
rejectOrder: { url: '/discord-marketplace/orders/{id}/reject', method: HTTP_METHODS.POST },
|
|
16358
|
+
requestChanges: { url: '/discord-marketplace/orders/{id}/request-changes', method: HTTP_METHODS.POST },
|
|
16359
|
+
resubmitOrder: { url: '/discord-marketplace/orders/{id}/resubmit', method: HTTP_METHODS.POST },
|
|
16360
|
+
};
|
|
16361
|
+
return DiscordMarketplaceRoute;
|
|
16362
|
+
}());
|
|
16363
|
+
|
|
16364
|
+
var DiscordMarketplace = /** @class */ (function () {
|
|
16365
|
+
function DiscordMarketplace() {
|
|
16366
|
+
}
|
|
16293
16367
|
/**
|
|
16294
|
-
*
|
|
16368
|
+
* Search for Discord servers available for sponsorship.
|
|
16295
16369
|
*/
|
|
16296
|
-
|
|
16297
|
-
return Requests.processRoute(
|
|
16370
|
+
DiscordMarketplace.listListings = function (params) {
|
|
16371
|
+
return Requests.processRoute(DiscordMarketplaceRoute.routes.listListings, undefined, undefined, params);
|
|
16298
16372
|
};
|
|
16299
16373
|
/**
|
|
16300
|
-
*
|
|
16374
|
+
* List a Discord server in the marketplace (Owner).
|
|
16301
16375
|
*/
|
|
16302
|
-
|
|
16303
|
-
return Requests.processRoute(
|
|
16376
|
+
DiscordMarketplace.createListing = function (data) {
|
|
16377
|
+
return Requests.processRoute(DiscordMarketplaceRoute.routes.createListing, data);
|
|
16304
16378
|
};
|
|
16305
16379
|
/**
|
|
16306
|
-
*
|
|
16307
|
-
* @param data { entry_id, prize_id }
|
|
16380
|
+
* Get details for a specific server listing.
|
|
16308
16381
|
*/
|
|
16309
|
-
|
|
16310
|
-
return Requests.processRoute(
|
|
16382
|
+
DiscordMarketplace.viewListing = function (id) {
|
|
16383
|
+
return Requests.processRoute(DiscordMarketplaceRoute.routes.viewListing, {}, { id: id });
|
|
16311
16384
|
};
|
|
16312
16385
|
/**
|
|
16313
|
-
*
|
|
16314
|
-
* @param entry_id The UUID of the RaffleEntry.
|
|
16386
|
+
* Update listing settings like price or auto-approve (Owner).
|
|
16315
16387
|
*/
|
|
16316
|
-
|
|
16317
|
-
return Requests.processRoute(
|
|
16388
|
+
DiscordMarketplace.updateListing = function (id, data) {
|
|
16389
|
+
return Requests.processRoute(DiscordMarketplaceRoute.routes.updateListing, data, { id: id });
|
|
16318
16390
|
};
|
|
16319
16391
|
/**
|
|
16320
|
-
*
|
|
16392
|
+
* Remove a server from the marketplace (Owner).
|
|
16321
16393
|
*/
|
|
16322
|
-
|
|
16323
|
-
return Requests.processRoute(
|
|
16394
|
+
DiscordMarketplace.deleteListing = function (id) {
|
|
16395
|
+
return Requests.processRoute(DiscordMarketplaceRoute.routes.deleteListing, {}, { id: id });
|
|
16324
16396
|
};
|
|
16325
16397
|
/**
|
|
16326
|
-
* List
|
|
16327
|
-
* @param params { opt_in_playtesting?, page?, per_page? }
|
|
16398
|
+
* List sponsored post orders. Use params { mode: 'buyer' | 'seller' }.
|
|
16328
16399
|
*/
|
|
16329
|
-
|
|
16330
|
-
return Requests.processRoute(
|
|
16400
|
+
DiscordMarketplace.listOrders = function (params) {
|
|
16401
|
+
return Requests.processRoute(DiscordMarketplaceRoute.routes.listOrders, undefined, undefined, params);
|
|
16331
16402
|
};
|
|
16332
16403
|
/**
|
|
16333
|
-
*
|
|
16404
|
+
* Submit a post to a Discord server for sponsorship (Game Developer).
|
|
16334
16405
|
*/
|
|
16335
|
-
|
|
16336
|
-
return Requests.processRoute(
|
|
16406
|
+
DiscordMarketplace.createOrder = function (data) {
|
|
16407
|
+
return Requests.processRoute(DiscordMarketplaceRoute.routes.createOrder, data);
|
|
16337
16408
|
};
|
|
16338
16409
|
/**
|
|
16339
|
-
* Get
|
|
16410
|
+
* Get details for a specific order.
|
|
16340
16411
|
*/
|
|
16341
|
-
|
|
16342
|
-
return Requests.processRoute(
|
|
16412
|
+
DiscordMarketplace.viewOrder = function (id) {
|
|
16413
|
+
return Requests.processRoute(DiscordMarketplaceRoute.routes.viewOrder, {}, { id: id });
|
|
16343
16414
|
};
|
|
16344
|
-
|
|
16415
|
+
/**
|
|
16416
|
+
* Approve and publish a sponsored post (Owner).
|
|
16417
|
+
*/
|
|
16418
|
+
DiscordMarketplace.approveOrder = function (id) {
|
|
16419
|
+
return Requests.processRoute(DiscordMarketplaceRoute.routes.approveOrder, {}, { id: id });
|
|
16420
|
+
};
|
|
16421
|
+
/**
|
|
16422
|
+
* Reject a sponsored post (Owner).
|
|
16423
|
+
*/
|
|
16424
|
+
DiscordMarketplace.rejectOrder = function (id, data) {
|
|
16425
|
+
return Requests.processRoute(DiscordMarketplaceRoute.routes.rejectOrder, data, { id: id });
|
|
16426
|
+
};
|
|
16427
|
+
/**
|
|
16428
|
+
* Request changes to the post content (Owner).
|
|
16429
|
+
*/
|
|
16430
|
+
DiscordMarketplace.requestChanges = function (id, data) {
|
|
16431
|
+
return Requests.processRoute(DiscordMarketplaceRoute.routes.requestChanges, data, { id: id });
|
|
16432
|
+
};
|
|
16433
|
+
/**
|
|
16434
|
+
* Resubmit a post after making requested changes (Game Developer).
|
|
16435
|
+
*/
|
|
16436
|
+
DiscordMarketplace.resubmitOrder = function (id) {
|
|
16437
|
+
return Requests.processRoute(DiscordMarketplaceRoute.routes.resubmitOrder, {}, { id: id });
|
|
16438
|
+
};
|
|
16439
|
+
return DiscordMarketplace;
|
|
16345
16440
|
}());
|
|
16346
16441
|
|
|
16347
16442
|
var Parser = /** @class */ (function () {
|
|
@@ -16873,6 +16968,7 @@ var Glitch = /** @class */ (function () {
|
|
|
16873
16968
|
MarketingAgencies: MarketingAgencies,
|
|
16874
16969
|
TwitchReporting: TwitchReporting,
|
|
16875
16970
|
Raffles: Raffles,
|
|
16971
|
+
DiscordMarketplace: DiscordMarketplace,
|
|
16876
16972
|
};
|
|
16877
16973
|
Glitch.util = {
|
|
16878
16974
|
Requests: Requests,
|