glitch-javascript-sdk 2.5.0 → 2.5.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 +66 -79
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Raffles.d.ts +52 -46
- package/dist/esm/index.js +66 -79
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +52 -46
- package/package.json +1 -1
- package/src/api/Raffles.ts +48 -63
- package/src/routes/RafflesRoute.ts +28 -28
|
@@ -2,91 +2,97 @@ 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
|
-
/**
|
|
79
|
-
* List all participants/entries for management.
|
|
80
|
-
* @param params { opt_in_playtesting?, page?, per_page? }
|
|
81
|
-
*/
|
|
82
|
-
static listParticipants<T>(raffle_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
83
89
|
/**
|
|
84
90
|
* Check if the raffle is fully funded in the community ledger.
|
|
85
91
|
*/
|
|
86
|
-
static escrowStatus<T>(
|
|
92
|
+
static escrowStatus<T>(id: string): AxiosPromise<Response<T>>;
|
|
87
93
|
/**
|
|
88
|
-
* Get viral loop analytics (K-
|
|
94
|
+
* Get viral loop analytics (K-Factor, Cost Per Entry).
|
|
89
95
|
*/
|
|
90
|
-
static analytics<T>(
|
|
96
|
+
static analytics<T>(id: string): AxiosPromise<Response<T>>;
|
|
91
97
|
}
|
|
92
98
|
export default Raffles;
|
package/dist/esm/index.js
CHANGED
|
@@ -16191,28 +16191,28 @@ 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
|
-
|
|
16199
|
-
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16209
|
-
|
|
16210
|
-
|
|
16196
|
+
view: { url: '/raffles/{id}', method: HTTP_METHODS.GET },
|
|
16197
|
+
enter: { url: '/raffles/{id}/enter', method: HTTP_METHODS.POST },
|
|
16198
|
+
me: { url: '/raffles/{id}/me', method: HTTP_METHODS.GET },
|
|
16199
|
+
performAction: { url: '/raffles/{id}/actions', method: HTTP_METHODS.POST },
|
|
16200
|
+
shareSocially: { url: '/raffles/{id}/share', method: HTTP_METHODS.POST },
|
|
16201
|
+
inviteFriend: { url: '/raffles/{id}/invite-friend', method: HTTP_METHODS.POST },
|
|
16202
|
+
// Prize Management
|
|
16203
|
+
addPrize: { url: '/raffles/{id}/prizes', method: HTTP_METHODS.POST },
|
|
16204
|
+
// Drawing & Winners
|
|
16205
|
+
drawWinners: { url: '/raffles/{id}/draw', method: HTTP_METHODS.POST },
|
|
16206
|
+
pickWinner: { url: '/raffles/{id}/pick-winner', method: HTTP_METHODS.POST },
|
|
16207
|
+
winners: { url: '/raffles/{id}/winners', method: HTTP_METHODS.GET },
|
|
16208
|
+
// Participant & Fulfillment Management
|
|
16209
|
+
participants: { url: '/raffles/{id}/participants', method: HTTP_METHODS.GET },
|
|
16211
16210
|
fulfillPrize: { url: '/raffles/entries/{entry_id}/fulfill', method: HTTP_METHODS.PUT },
|
|
16212
|
-
|
|
16213
|
-
|
|
16214
|
-
|
|
16215
|
-
|
|
16211
|
+
updateAddress: { url: '/raffles/entries/{entry_id}/address', method: HTTP_METHODS.PUT },
|
|
16212
|
+
disqualify: { url: '/raffles/{id}/disqualify/{entry_id}', method: HTTP_METHODS.POST },
|
|
16213
|
+
// Analytics & Finance
|
|
16214
|
+
escrowStatus: { url: '/raffles/{id}/escrow', method: HTTP_METHODS.GET },
|
|
16215
|
+
analytics: { url: '/raffles/{id}/analytics', method: HTTP_METHODS.GET },
|
|
16216
16216
|
};
|
|
16217
16217
|
return RafflesRoute;
|
|
16218
16218
|
}());
|
|
@@ -16221,125 +16221,112 @@ var Raffles = /** @class */ (function () {
|
|
|
16221
16221
|
function Raffles() {
|
|
16222
16222
|
}
|
|
16223
16223
|
/**
|
|
16224
|
-
* List all raffles.
|
|
16225
|
-
* @param params Filter by title_id, community_id, or status.
|
|
16224
|
+
* List all raffles with optional filters.
|
|
16226
16225
|
*/
|
|
16227
16226
|
Raffles.list = function (params) {
|
|
16228
16227
|
return Requests.processRoute(RafflesRoute.routes.list, undefined, undefined, params);
|
|
16229
16228
|
};
|
|
16230
16229
|
/**
|
|
16231
|
-
* Create a new raffle
|
|
16230
|
+
* Create a new raffle (Game Owner).
|
|
16232
16231
|
*/
|
|
16233
16232
|
Raffles.create = function (data) {
|
|
16234
16233
|
return Requests.processRoute(RafflesRoute.routes.create, data);
|
|
16235
16234
|
};
|
|
16236
16235
|
/**
|
|
16237
|
-
*
|
|
16236
|
+
* Retrieve details for a specific raffle.
|
|
16238
16237
|
*/
|
|
16239
|
-
Raffles.view = function (
|
|
16240
|
-
return Requests.processRoute(RafflesRoute.routes.view, {}, {
|
|
16238
|
+
Raffles.view = function (id) {
|
|
16239
|
+
return Requests.processRoute(RafflesRoute.routes.view, {}, { id: id });
|
|
16241
16240
|
};
|
|
16242
16241
|
/**
|
|
16243
|
-
*
|
|
16242
|
+
* Enter a raffle (User/Player). Requires Steam ID.
|
|
16244
16243
|
*/
|
|
16245
|
-
Raffles.
|
|
16246
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16244
|
+
Raffles.enter = function (id, data) {
|
|
16245
|
+
return Requests.processRoute(RafflesRoute.routes.enter, data, { id: id });
|
|
16247
16246
|
};
|
|
16248
16247
|
/**
|
|
16249
|
-
*
|
|
16248
|
+
* Get the authenticated user's entry status for a specific raffle.
|
|
16250
16249
|
*/
|
|
16251
|
-
Raffles.
|
|
16252
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16250
|
+
Raffles.me = function (id) {
|
|
16251
|
+
return Requests.processRoute(RafflesRoute.routes.me, {}, { id: id });
|
|
16253
16252
|
};
|
|
16254
16253
|
/**
|
|
16255
|
-
*
|
|
16256
|
-
* @param data { referral_code?, device_fingerprint? }
|
|
16254
|
+
* Record a viral action (e.g., Steam Wishlist, Social Share).
|
|
16257
16255
|
*/
|
|
16258
|
-
Raffles.
|
|
16259
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16256
|
+
Raffles.performAction = function (id, data) {
|
|
16257
|
+
return Requests.processRoute(RafflesRoute.routes.performAction, data, { id: id });
|
|
16260
16258
|
};
|
|
16261
16259
|
/**
|
|
16262
|
-
*
|
|
16263
|
-
* @param data { action_type: 'steam_wishlist'|'social_share', platform?, reference_id? }
|
|
16260
|
+
* Post raffle content to social media via Glitch API.
|
|
16264
16261
|
*/
|
|
16265
|
-
Raffles.
|
|
16266
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16262
|
+
Raffles.shareSocially = function (id, data) {
|
|
16263
|
+
return Requests.processRoute(RafflesRoute.routes.shareSocially, data, { id: id });
|
|
16267
16264
|
};
|
|
16268
16265
|
/**
|
|
16269
|
-
*
|
|
16266
|
+
* Send an invitation email to a friend.
|
|
16270
16267
|
*/
|
|
16271
|
-
Raffles.
|
|
16272
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16268
|
+
Raffles.inviteFriend = function (id, data) {
|
|
16269
|
+
return Requests.processRoute(RafflesRoute.routes.inviteFriend, data, { id: id });
|
|
16273
16270
|
};
|
|
16274
16271
|
/**
|
|
16275
|
-
*
|
|
16276
|
-
* @param entry_id The UUID of the RaffleEntry.
|
|
16272
|
+
* Add a prize tier to a raffle (Game Owner).
|
|
16277
16273
|
*/
|
|
16278
|
-
Raffles.
|
|
16279
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16274
|
+
Raffles.addPrize = function (id, data) {
|
|
16275
|
+
return Requests.processRoute(RafflesRoute.routes.addPrize, data, { id: id });
|
|
16280
16276
|
};
|
|
16281
16277
|
/**
|
|
16282
|
-
*
|
|
16278
|
+
* Trigger the automated drawing process (Game Owner).
|
|
16283
16279
|
*/
|
|
16284
|
-
Raffles.
|
|
16285
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16280
|
+
Raffles.drawWinners = function (id) {
|
|
16281
|
+
return Requests.processRoute(RafflesRoute.routes.drawWinners, {}, { id: id });
|
|
16286
16282
|
};
|
|
16287
16283
|
/**
|
|
16288
|
-
*
|
|
16284
|
+
* Manually select a winner for a specific prize (Live Event Mode).
|
|
16289
16285
|
*/
|
|
16290
|
-
Raffles.
|
|
16291
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16286
|
+
Raffles.pickWinner = function (id, data) {
|
|
16287
|
+
return Requests.processRoute(RafflesRoute.routes.pickWinner, data, { id: id });
|
|
16292
16288
|
};
|
|
16293
16289
|
/**
|
|
16294
|
-
*
|
|
16290
|
+
* Get the public list of winners for a completed raffle.
|
|
16295
16291
|
*/
|
|
16296
|
-
Raffles.
|
|
16297
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16292
|
+
Raffles.winners = function (id) {
|
|
16293
|
+
return Requests.processRoute(RafflesRoute.routes.winners, {}, { id: id });
|
|
16298
16294
|
};
|
|
16299
16295
|
/**
|
|
16300
|
-
*
|
|
16296
|
+
* List all participants/entries for a raffle (Game Owner).
|
|
16301
16297
|
*/
|
|
16302
|
-
Raffles.
|
|
16303
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16298
|
+
Raffles.participants = function (id, params) {
|
|
16299
|
+
return Requests.processRoute(RafflesRoute.routes.participants, {}, { id: id }, params);
|
|
16304
16300
|
};
|
|
16305
16301
|
/**
|
|
16306
|
-
*
|
|
16307
|
-
* @param data { entry_id, prize_id }
|
|
16308
|
-
*/
|
|
16309
|
-
Raffles.pickWinner = function (raffle_id, data) {
|
|
16310
|
-
return Requests.processRoute(RafflesRoute.routes.pickWinner, data, { raffle_id: raffle_id });
|
|
16311
|
-
};
|
|
16312
|
-
/**
|
|
16313
|
-
* Provide shipping/tracking info for a prize fulfillment.
|
|
16314
|
-
* @param entry_id The UUID of the RaffleEntry.
|
|
16302
|
+
* Update shipping/tracking info for a prize (Game Owner).
|
|
16315
16303
|
*/
|
|
16316
16304
|
Raffles.fulfillPrize = function (entry_id, data) {
|
|
16317
16305
|
return Requests.processRoute(RafflesRoute.routes.fulfillPrize, data, { entry_id: entry_id });
|
|
16318
16306
|
};
|
|
16319
16307
|
/**
|
|
16320
|
-
*
|
|
16308
|
+
* Submit shipping address for a won prize (User/Winner).
|
|
16321
16309
|
*/
|
|
16322
|
-
Raffles.
|
|
16323
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16310
|
+
Raffles.updateAddress = function (entry_id, data) {
|
|
16311
|
+
return Requests.processRoute(RafflesRoute.routes.updateAddress, data, { entry_id: entry_id });
|
|
16324
16312
|
};
|
|
16325
16313
|
/**
|
|
16326
|
-
*
|
|
16327
|
-
* @param params { opt_in_playtesting?, page?, per_page? }
|
|
16314
|
+
* Disqualify a specific entry (Game Owner).
|
|
16328
16315
|
*/
|
|
16329
|
-
Raffles.
|
|
16330
|
-
return Requests.processRoute(RafflesRoute.routes.
|
|
16316
|
+
Raffles.disqualify = function (id, entry_id, data) {
|
|
16317
|
+
return Requests.processRoute(RafflesRoute.routes.disqualify, data, { id: id, entry_id: entry_id });
|
|
16331
16318
|
};
|
|
16332
16319
|
/**
|
|
16333
16320
|
* Check if the raffle is fully funded in the community ledger.
|
|
16334
16321
|
*/
|
|
16335
|
-
Raffles.escrowStatus = function (
|
|
16336
|
-
return Requests.processRoute(RafflesRoute.routes.escrowStatus, {}, {
|
|
16322
|
+
Raffles.escrowStatus = function (id) {
|
|
16323
|
+
return Requests.processRoute(RafflesRoute.routes.escrowStatus, {}, { id: id });
|
|
16337
16324
|
};
|
|
16338
16325
|
/**
|
|
16339
|
-
* Get viral loop analytics (K-
|
|
16326
|
+
* Get viral loop analytics (K-Factor, Cost Per Entry).
|
|
16340
16327
|
*/
|
|
16341
|
-
Raffles.analytics = function (
|
|
16342
|
-
return Requests.processRoute(RafflesRoute.routes.analytics, {}, {
|
|
16328
|
+
Raffles.analytics = function (id) {
|
|
16329
|
+
return Requests.processRoute(RafflesRoute.routes.analytics, {}, { id: id });
|
|
16343
16330
|
};
|
|
16344
16331
|
return Raffles;
|
|
16345
16332
|
}());
|